diff --git a/docs/io.sarl.docs.markdown/pom.xml b/docs/io.sarl.docs.markdown/pom.xml index 16a3e9698e..01d78a0e84 100644 --- a/docs/io.sarl.docs.markdown/pom.xml +++ b/docs/io.sarl.docs.markdown/pom.xml @@ -43,6 +43,10 @@ io.sarl.maven sarl-maven-plugin + + io.sarl.lang + io.sarl.lang.core + io.sarl.lang io.sarl.lang diff --git a/docs/io.sarl.docs.markdown/src/main/documentation/reference/LanguageComparison.md b/docs/io.sarl.docs.markdown/src/main/documentation/reference/LanguageComparison.md index d2136a1559..ad7ace4ed0 100644 --- a/docs/io.sarl.docs.markdown/src/main/documentation/reference/LanguageComparison.md +++ b/docs/io.sarl.docs.markdown/src/main/documentation/reference/LanguageComparison.md @@ -23,17 +23,17 @@ environment (Eclipse, IntelliJ...) Yes Yes Yes -Object-oriented enumeration +Object-oriented enumeration No, only constants could be defined Yes, constants and functions could be defined No, only constants could be defined Yes, constants and functions could be defined -Definition of annotation types +Definition of annotation types Yes Yes Yes Yes -Definition of static constructors +Definition of static constructors Yes Yes No diff --git a/docs/io.sarl.docs.markdown/src/main/documentation/reference/general/Extension.md b/docs/io.sarl.docs.markdown/src/main/documentation/reference/general/Extension.md index 949483a9c7..21c17ebdd8 100644 --- a/docs/io.sarl.docs.markdown/src/main/documentation/reference/general/Extension.md +++ b/docs/io.sarl.docs.markdown/src/main/documentation/reference/general/Extension.md @@ -190,45 +190,45 @@ The following functions are provided for extended the standard number API: org.eclipse.xtext.xbase.lib.IntegerExtensions, org.eclipse.xtext.xbase.lib.LongExtensions, org.eclipse.xtext.xbase.lib.ShortExtensions, - io.sarl.lang.scoping.numbers.arithmetic.AtomicIntegerArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.AtomicLongArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.ByteArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.DoubleArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.FloatArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.IntegerArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.LongArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.NumberArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.PrimitiveByteArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.PrimitiveFloatArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.PrimitiveIntArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.PrimitiveLongArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.PrimitiveShortArithmeticExtensions, - io.sarl.lang.scoping.numbers.arithmetic.ShortArithmeticExtensions, - io.sarl.lang.scoping.numbers.comparison.AtomicIntegerComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.AtomicLongComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.ByteComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.DoubleComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.FloatComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.IntegerComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.LongComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.NumberComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.PrimitiveByteComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.PrimitiveDoubleComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.PrimitiveFloatComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.PrimitiveIntComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.PrimitiveLongComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.PrimitiveShortComparisonExtensions, - io.sarl.lang.scoping.numbers.comparison.ShortComparisonExtensions, - io.sarl.lang.scoping.numbers.casts.AtomicIntegerCastExtensions, - io.sarl.lang.scoping.numbers.casts.AtomicLongCastExtensions, - io.sarl.lang.scoping.numbers.casts.NumberCastExtensions, - io.sarl.lang.scoping.numbers.casts.PrimitiveByteCastExtensions, - io.sarl.lang.scoping.numbers.casts.PrimitiveDoubleCastExtensions, - io.sarl.lang.scoping.numbers.casts.PrimitiveFloatCastExtensions, - io.sarl.lang.scoping.numbers.casts.PrimitiveIntCastExtensions, - io.sarl.lang.scoping.numbers.casts.PrimitiveLongCastExtensions, - io.sarl.lang.scoping.numbers.casts.PrimitiveShortCastExtensions + io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicIntegerArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicLongArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.ByteArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.DoubleArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.NumberArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveByteArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveFloatArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveIntArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveLongArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveShortArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.AtomicIntegerComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.AtomicLongComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.NumberComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions, + io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions, + io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions, + io.sarl.lang.scoping.extensions.numbers.cast.NumberCastExtensions, + io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveByteCastExtensions, + io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveDoubleCastExtensions, + io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveFloatCastExtensions, + io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveIntCastExtensions, + io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveLongCastExtensions, + io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveShortCastExtensions )} @@ -265,7 +265,7 @@ The following functions are provided for extended the standard Lambda expression The following functions are provided for extended the standard time API: [:DynamicCode:]{io.sarl.maven.docs.testing.ReflectExtensions.getPublicMethods( - io.sarl.lang.scoping.batch.SARLTimeExtensions)} + io.sarl.lang.scoping.extensions.time.TimeExtensions)} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/AtomicIntegerArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/AtomicIntegerArithmeticExtensionsTest.java deleted file mode 100644 index f3b3f7f34a..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/AtomicIntegerArithmeticExtensionsTest.java +++ /dev/null @@ -1,2882 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicIntegerArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicIntegerArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicIntegerArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicIntegerArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicIntegerArithmeticExtensions.operator_plus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicIntegerArithmeticExtensions.operator_power; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - AtomicIntegerArithmeticExtensionsTest.Code.class, - AtomicIntegerArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class AtomicIntegerArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static AtomicInteger left = new AtomicInteger(4); - - private static int right = 3; - - @Test - public void operator_minus_AtomicInteger() throws Exception { - assertEquals(-4, operator_minus(left)); - } - - @Test - public void operator_minus_AtomicInteger_Number() throws Exception { - assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_minus_AtomicInteger_long() throws Exception { - assertEquals(1, operator_minus(left, (long) right)); - } - - @Test - public void operator_minus_AtomicInteger_Long() throws Exception { - assertEquals(1, operator_minus(left, Long.valueOf(right))); - } - - @Test - public void operator_minus_AtomicInteger_byte() throws Exception { - assertEquals(1, operator_minus(left, (byte)right)); - } - - @Test - public void operator_minus_AtomicInteger_Byte() throws Exception { - assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); - } - - @Test - public void operator_minus_AtomicInteger_float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, (float) right)); - } - - @Test - public void operator_minus_AtomicInteger_Float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); - } - - @Test - public void operator_minus_AtomicInteger_int() throws Exception { - assertEquals(1, operator_minus(left, (int) right)); - } - - @Test - public void operator_minus_AtomicInteger_Integer() throws Exception { - assertEquals(1, operator_minus(left, Integer.valueOf(right))); - } - - @Test - public void operator_minus_AtomicInteger_short() throws Exception { - assertEquals(1, operator_minus(left, (short) right)); - } - - @Test - public void operator_minus_AtomicInteger_Short() throws Exception { - assertEquals(1, operator_minus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_minus_AtomicInteger_AtomicInteger() throws Exception { - assertEquals(1, operator_minus(left, new AtomicInteger(right))); - } - - @Test - public void operator_minus_AtomicInteger_AtomicLong() throws Exception { - assertEquals(1l, operator_minus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_AtomicInteger_long() throws Exception { - assertEquals(7l, operator_plus(left, (long) right)); - } - - @Test - public void operator_plus_AtomicInteger_Long() throws Exception { - assertEquals(7l, operator_plus(left, Long.valueOf(right))); - } - - @Test - public void operator_plus_AtomicInteger_byte() throws Exception { - assertEquals(7, operator_plus(left, (byte) right)); - } - - @Test - public void operator_plus_AtomicInteger_Byte() throws Exception { - assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_plus_AtomicInteger_float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, (float) right)); - } - - @Test - public void operator_plus_AtomicInteger_Float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); - } - - @Test - public void operator_plus_AtomicInteger_int() throws Exception { - assertEquals(7, operator_plus(left, (int) right)); - } - - @Test - public void operator_plus_AtomicInteger_Integer() throws Exception { - assertEquals(7, operator_plus(left, Integer.valueOf(right))); - } - - @Test - public void operator_plus_AtomicInteger_short() throws Exception { - assertEquals(7, operator_plus(left, (short) right)); - } - - @Test - public void operator_plus_AtomicInteger_Short() throws Exception { - assertEquals(7, operator_plus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_plus_AtomicInteger_AtomicInteger() throws Exception { - assertEquals(7, operator_plus(left, new AtomicInteger(right))); - } - - @Test - public void operator_plus_AtomicInteger_AtomicLong() throws Exception { - assertEquals(7l, operator_plus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_AtomicInteger_Number() throws Exception { - assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_AtomicInteger_Number() throws Exception { - assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); - } - - - @Test - public void operator_power_AtomicInteger_byte() throws Exception { - assertEpsilonEquals(64., operator_power(left, (byte) right)); - } - - @Test - public void operator_power_AtomicInteger_short() throws Exception { - assertEpsilonEquals(64., operator_power(left, (short) right)); - } - - @Test - public void operator_power_AtomicInteger_int() throws Exception { - assertEpsilonEquals(64., operator_power(left, (int) right)); - } - - @Test - public void operator_power_AtomicInteger_long() throws Exception { - assertEpsilonEquals(64., operator_power(left, (long) right)); - } - - @Test - public void operator_power_AtomicInteger_float() throws Exception { - assertEpsilonEquals(64., operator_power(left, (float) right)); - } - - @Test - public void operator_power_AtomicInteger_double() throws Exception { - assertEpsilonEquals(64., operator_power(left, (double) right)); - } - - @Test - public void operator_divide_AtomicInteger_long() throws Exception { - assertEquals(1l, operator_divide(left, (long) right)); - } - - @Test - public void operator_divide_AtomicInteger_Long() throws Exception { - assertEquals(1l, operator_divide(left, Long.valueOf(right))); - } - - @Test - public void operator_divide_AtomicInteger_byte() throws Exception { - assertEquals(1l, operator_divide(left, (byte) right)); - } - - @Test - public void operator_divide_AtomicInteger_Byte() throws Exception { - assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_divide_AtomicInteger_float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, (float) right)); - } - - @Test - public void operator_divide_AtomicInteger_Float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); - } - - @Test - public void operator_divide_AtomicInteger_int() throws Exception { - assertEquals(1, operator_divide(left, (int) right)); - } - - @Test - public void operator_divide_AtomicInteger_Integer() throws Exception { - assertEquals(1, operator_divide(left, Integer.valueOf(right))); - } - - @Test - public void operator_divide_AtomicInteger_Number() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_divide_AtomicInteger_short() throws Exception { - assertEquals(1, operator_divide(left, (short) right)); - } - - @Test - public void operator_divide_AtomicInteger_Short() throws Exception { - assertEquals(1, operator_divide(left, Short.valueOf((short) right))); - } - - @Test - public void operator_divide_AtomicInteger_AtomicInteger() throws Exception { - assertEquals(1, operator_divide(left, new AtomicInteger(right))); - } - - @Test - public void operator_divide_AtomicInteger_AtomicLong() throws Exception { - assertEquals(1l, operator_divide(left, new AtomicLong(right))); - } - - @Test - public void operator_multiply_AtomicInteger_long() throws Exception { - assertEquals(12l, operator_multiply(left, (long) right)); - } - - @Test - public void operator_multiply_AtomicInteger_Long() throws Exception { - assertEquals(12l, operator_multiply(left, Long.valueOf(right))); - } - - @Test - public void operator_multiply_AtomicInteger_byte() throws Exception { - assertEquals(12, operator_multiply(left, (byte) right)); - } - - @Test - public void operator_multiply_AtomicInteger_Byte() throws Exception { - assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_multiply_AtomicInteger_float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, (float) right)); - } - - @Test - public void operator_multiply_AtomicInteger_Float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); - } - - @Test - public void operator_multiply_AtomicInteger_int() throws Exception { - assertEquals(12, operator_multiply(left, (int) right)); - } - - @Test - public void operator_multiply_AtomicInteger_Integer() throws Exception { - assertEquals(12, operator_multiply(left, Integer.valueOf(right))); - } - - @Test - public void operator_multiply_AtomicInteger_Number() throws Exception { - assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_multiply_AtomicInteger_short() throws Exception { - assertEquals(12, operator_multiply(left, (short) right)); - } - - @Test - public void operator_multiply_AtomicInteger_Short() throws Exception { - assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); - } - - @Test - public void operator_multiply_AtomicInteger_AtomicInteger() throws Exception { - assertEquals(12, operator_multiply(left, new AtomicInteger(right))); - } - - @Test - public void operator_multiply_AtomicInteger_AtomicLong() throws Exception { - assertEquals(12l, operator_multiply(left, new AtomicLong(right))); - } - - @Test - public void operator_modulo_AtomicInteger_long() throws Exception { - assertEquals(1l, operator_modulo(left, (long) right)); - } - - @Test - public void operator_modulo_AtomicInteger_Long() throws Exception { - assertEquals(1l, operator_modulo(left, Long.valueOf(right))); - } - - @Test - public void operator_modulo_AtomicInteger_byte() throws Exception { - assertEquals(1l, operator_modulo(left, (byte) right)); - } - - @Test - public void operator_modulo_AtomicInteger_Byte() throws Exception { - assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_modulo_AtomicInteger_float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, (float) right)); - } - - @Test - public void operator_modulo_AtomicInteger_Float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); - } - - @Test - public void operator_modulo_AtomicInteger_int() throws Exception { - assertEquals(1, operator_modulo(left, (int) right)); - } - - @Test - public void operator_modulo_AtomicInteger_Integer() throws Exception { - assertEquals(1, operator_modulo(left, Integer.valueOf(right))); - } - - @Test - public void operator_modulo_AtomicInteger_Number() throws Exception { - assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_modulo_AtomicInteger_short() throws Exception { - assertEquals(1, operator_modulo(left, (short) right)); - } - - @Test - public void operator_modulo_AtomicInteger_Short() throws Exception { - assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); - } - - @Test - public void operator_modulo_AtomicInteger_AtomicInteger() throws Exception { - assertEquals(1, operator_modulo(left, new AtomicInteger(right))); - } - - @Test - public void operator_modulo_AtomicInteger_AtomicLong() throws Exception { - assertEquals(1l, operator_modulo(left, new AtomicLong(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : int {", - " -left", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left) {", - " return (-(left.intValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicInteger_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicInteger left, final AtomicDouble right) {", - " return (left.intValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicInteger_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final long right) {", - " return (left.intValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicInteger_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final Long right) {", - " return (left.intValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicInteger_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : byte) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final byte right) {", - " return (left.intValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicInteger_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Byte) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Byte right) {", - " return (left.intValue() - right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicInteger_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicInteger left, final float right) {", - " return (left.intValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicInteger_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicInteger left, final Float right) {", - " return (left.intValue() - right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicInteger_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : int) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final int right) {", - " return (left.intValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicInteger_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Integer) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Integer right) {", - " return (left.intValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicInteger_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : short) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final short right) {", - " return (left.intValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicInteger_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Short) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Short right) {", - " return (left.intValue() - right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicInteger_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : AtomicInteger) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final AtomicInteger right) {", - " return (left.intValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicInteger_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicInteger, right : AtomicLong) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final AtomicLong right) {", - " return (left.intValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicInteger_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final Long right) {", - " return (left.intValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicInteger_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final long right) {", - " return (left.intValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicInteger_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : byte) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final byte right) {", - " return (left.intValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicInteger_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Byte) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Byte right) {", - " return (left.intValue() + right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicInteger_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicInteger left, final Float right) {", - " return (left.intValue() + right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicInteger_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicInteger left, final float right) {", - " return (left.intValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicInteger_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Integer) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Integer right) {", - " return (left.intValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicInteger_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : int) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final int right) {", - " return (left.intValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicInteger_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : short) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final short right) {", - " return (left.intValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicInteger_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Short) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Short right) {", - " return (left.intValue() + right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicInteger_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : AtomicInteger) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final AtomicInteger right) {", - " return (left.intValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicInteger_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final Long right) {", - " return (left.intValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicInteger_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicInteger left, final AtomicDouble right) {", - " return (left.intValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicInteger_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicInteger left, final AtomicDouble right) {", - " return Math.pow(left.intValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicInteger_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : byte) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicInteger left, final byte right) {", - " return Math.pow(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicInteger_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : short) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicInteger left, final short right) {", - " return Math.pow(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicInteger_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : int) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicInteger left, final int right) {", - " return Math.pow(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicInteger_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : long) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicInteger left, final long right) {", - " return Math.pow(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicInteger_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : float) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicInteger left, final float right) {", - " return Math.pow(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicInteger_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : double) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicInteger left, final double right) {", - " return Math.pow(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicInteger_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final long right) {", - " return (left.intValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicInteger_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final Long right) {", - " return (left.intValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicInteger_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : byte) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final byte right) {", - " return (left.intValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicInteger_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Byte) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Byte right) {", - " return (left.intValue() / right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicInteger_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicInteger left, final float right) {", - " return (left.intValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicInteger_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicInteger left, final Float right) {", - " return (left.intValue() / right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicInteger_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : int) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final int right) {", - " return (left.intValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicInteger_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Integer) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Integer right) {", - " return (left.intValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicInteger_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicInteger left, final AtomicDouble right) {", - " return (left.intValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicInteger_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : short) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final short right) {", - " return (left.intValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicInteger_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Short) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Short right) {", - " return (left.intValue() / right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicInteger_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : AtomicInteger) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final AtomicInteger right) {", - " return (left.intValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicInteger_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicInteger, right : AtomicLong) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final AtomicLong right) {", - " return (left.intValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicInteger_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final long right) {", - " return (left.intValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicInteger_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final Long right) {", - " return (left.intValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicInteger_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : byte) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final byte right) {", - " return (left.intValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicInteger_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Byte) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Byte right) {", - " return (left.intValue() * right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicInteger_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicInteger left, final float right) {", - " return (left.intValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicInteger_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicInteger left, final Float right) {", - " return (left.intValue() * right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicInteger_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : int) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final int right) {", - " return (left.intValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicInteger_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Integer) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Integer right) {", - " return (left.intValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicInteger_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicInteger left, final AtomicDouble right) {", - " return (left.intValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicInteger_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : short) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final short right) {", - " return (left.intValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicInteger_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Short) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Short right) {", - " return (left.intValue() * right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicInteger_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : AtomicInteger) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final AtomicInteger right) {", - " return (left.intValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicInteger_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicInteger, right : AtomicLong) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final AtomicLong right) {", - " return (left.intValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicInteger_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final long right) {", - " return (left.intValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicInteger_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final Long right) {", - " return (left.intValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicInteger_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Byte) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Byte right) {", - " return (left.intValue() % right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicInteger_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : byte) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final byte right) {", - " return (left.intValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicInteger_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicInteger left, final float right) {", - " return (left.intValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicInteger_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicInteger left, final Float right) {", - " return (left.intValue() % right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicInteger_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : int) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final int right) {", - " return (left.intValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicInteger_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Integer) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Integer right) {", - " return (left.intValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicInteger_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicInteger left, final AtomicDouble right) {", - " return (left.intValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicInteger_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : short) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final short right) {", - " return (left.intValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicInteger_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : Short) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final Short right) {", - " return (left.intValue() % right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicInteger_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger, right : AtomicInteger) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final AtomicInteger left, final AtomicInteger right) {", - " return (left.intValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicInteger_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicInteger, right : AtomicLong) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicInteger left, final AtomicLong right) {", - " return (left.intValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/AtomicLongArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/AtomicLongArithmeticExtensionsTest.java deleted file mode 100644 index ab5aa965c0..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/AtomicLongArithmeticExtensionsTest.java +++ /dev/null @@ -1,2883 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicLongArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicLongArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicLongArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicLongArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicLongArithmeticExtensions.operator_plus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicLongArithmeticExtensions.operator_power; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - AtomicLongArithmeticExtensionsTest.Code.class, - AtomicLongArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class AtomicLongArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static AtomicLong left = new AtomicLong(4); - - private static int right = 3; - - @Test - public void operator_minus_AtomicLong() throws Exception { - assertEquals(-4, operator_minus(left)); - } - - @Test - public void operator_minus_AtomicLong_Number() throws Exception { - assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_minus_AtomicLong_long() throws Exception { - assertEquals(1, operator_minus(left, (long) right)); - } - - @Test - public void operator_minus_AtomicLong_Long() throws Exception { - assertEquals(1, operator_minus(left, Long.valueOf(right))); - } - - @Test - public void operator_minus_AtomicLong_byte() throws Exception { - assertEquals(1, operator_minus(left, (byte)right)); - } - - @Test - public void operator_minus_AtomicLong_Byte() throws Exception { - assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); - } - - @Test - public void operator_minus_AtomicLong_float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, (float) right)); - } - - @Test - public void operator_minus_AtomicLong_Float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); - } - - @Test - public void operator_minus_AtomicLong_int() throws Exception { - assertEquals(1, operator_minus(left, (int) right)); - } - - @Test - public void operator_minus_AtomicLong_Integer() throws Exception { - assertEquals(1, operator_minus(left, Integer.valueOf(right))); - } - - @Test - public void operator_minus_AtomicLong_short() throws Exception { - assertEquals(1, operator_minus(left, (short) right)); - } - - @Test - public void operator_minus_AtomicLong_Short() throws Exception { - assertEquals(1, operator_minus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_minus_AtomicLong_AtomicInteger() throws Exception { - assertEquals(1, operator_minus(left, new AtomicInteger(right))); - } - - @Test - public void operator_minus_AtomicLong_AtomicLong() throws Exception { - assertEquals(1l, operator_minus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_AtomicLong_long() throws Exception { - assertEquals(7l, operator_plus(left, (long) right)); - } - - @Test - public void operator_plus_AtomicLong_Long() throws Exception { - assertEquals(7l, operator_plus(left, Long.valueOf(right))); - } - - @Test - public void operator_plus_AtomicLong_byte() throws Exception { - assertEquals(7, operator_plus(left, (byte) right)); - } - - @Test - public void operator_plus_AtomicLong_Byte() throws Exception { - assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_plus_AtomicLong_float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, (float) right)); - } - - @Test - public void operator_plus_AtomicLong_Float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); - } - - @Test - public void operator_plus_AtomicLong_int() throws Exception { - assertEquals(7, operator_plus(left, (int) right)); - } - - @Test - public void operator_plus_AtomicLong_Integer() throws Exception { - assertEquals(7, operator_plus(left, Integer.valueOf(right))); - } - - @Test - public void operator_plus_AtomicLong_short() throws Exception { - assertEquals(7, operator_plus(left, (short) right)); - } - - @Test - public void operator_plus_AtomicLong_Short() throws Exception { - assertEquals(7, operator_plus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_plus_AtomicLong_AtomicInteger() throws Exception { - assertEquals(7, operator_plus(left, new AtomicInteger(right))); - } - - @Test - public void operator_plus_AtomicLong_AtomicLong() throws Exception { - assertEquals(7l, operator_plus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_AtomicLong_Number() throws Exception { - assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_AtomicLong_Number() throws Exception { - assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_power_AtomicLong_byte() throws Exception { - assertEpsilonEquals(64., operator_power(left, (byte) right)); - } - - @Test - public void operator_power_AtomicLong_short() throws Exception { - assertEpsilonEquals(64., operator_power(left, (short) right)); - } - - @Test - public void operator_power_AtomicLong_int() throws Exception { - assertEpsilonEquals(64., operator_power(left, (int) right)); - } - - @Test - public void operator_power_AtomicLong_long() throws Exception { - assertEpsilonEquals(64., operator_power(left, (long) right)); - } - - @Test - public void operator_power_AtomicLong_float() throws Exception { - assertEpsilonEquals(64., operator_power(left, (float) right)); - } - - @Test - public void operator_power_AtomicLong_double() throws Exception { - assertEpsilonEquals(64., operator_power(left, (double) right)); - } - - @Test - public void operator_divide_AtomicLong_long() throws Exception { - assertEquals(1l, operator_divide(left, (long) right)); - } - - @Test - public void operator_divide_AtomicLong_Long() throws Exception { - assertEquals(1l, operator_divide(left, Long.valueOf(right))); - } - - @Test - public void operator_divide_AtomicLong_byte() throws Exception { - assertEquals(1l, operator_divide(left, (byte) right)); - } - - @Test - public void operator_divide_AtomicLong_Byte() throws Exception { - assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_divide_AtomicLong_float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, (float) right)); - } - - @Test - public void operator_divide_AtomicLong_Float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); - } - - @Test - public void operator_divide_AtomicLong_int() throws Exception { - assertEquals(1, operator_divide(left, (int) right)); - } - - @Test - public void operator_divide_AtomicLong_Integer() throws Exception { - assertEquals(1, operator_divide(left, Integer.valueOf(right))); - } - - @Test - public void operator_divide_AtomicLong_Number() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_divide_AtomicLong_short() throws Exception { - assertEquals(1, operator_divide(left, (short) right)); - } - - @Test - public void operator_divide_AtomicLong_Short() throws Exception { - assertEquals(1, operator_divide(left, Short.valueOf((short) right))); - } - - @Test - public void operator_divide_AtomicLong_AtomicInteger() throws Exception { - assertEquals(1, operator_divide(left, new AtomicInteger(right))); - } - - @Test - public void operator_divide_AtomicLong_AtomicLong() throws Exception { - assertEquals(1l, operator_divide(left, new AtomicLong(right))); - } - - @Test - public void operator_multiply_AtomicLong_long() throws Exception { - assertEquals(12l, operator_multiply(left, (long) right)); - } - - @Test - public void operator_multiply_AtomicLong_Long() throws Exception { - assertEquals(12l, operator_multiply(left, Long.valueOf(right))); - } - - @Test - public void operator_multiply_AtomicLong_byte() throws Exception { - assertEquals(12, operator_multiply(left, (byte) right)); - } - - @Test - public void operator_multiply_AtomicLong_Byte() throws Exception { - assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_multiply_AtomicLong_float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, (float) right)); - } - - @Test - public void operator_multiply_AtomicLong_Float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); - } - - @Test - public void operator_multiply_AtomicLong_int() throws Exception { - assertEquals(12, operator_multiply(left, (int) right)); - } - - @Test - public void operator_multiply_AtomicLong_Integer() throws Exception { - assertEquals(12, operator_multiply(left, Integer.valueOf(right))); - } - - @Test - public void operator_multiply_AtomicLong_Number() throws Exception { - assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_multiply_AtomicLong_short() throws Exception { - assertEquals(12, operator_multiply(left, (short) right)); - } - - @Test - public void operator_multiply_AtomicLong_Short() throws Exception { - assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); - } - - @Test - public void operator_multiply_AtomicLong_AtomicInteger() throws Exception { - assertEquals(12, operator_multiply(left, new AtomicInteger(right))); - } - - @Test - public void operator_multiply_AtomicLong_AtomicLong() throws Exception { - assertEquals(12l, operator_multiply(left, new AtomicLong(right))); - } - - @Test - public void operator_modulo_AtomicLong_long() throws Exception { - assertEquals(1l, operator_modulo(left, (long) right)); - } - - @Test - public void operator_modulo_AtomicLong_Long() throws Exception { - assertEquals(1l, operator_modulo(left, Long.valueOf(right))); - } - - @Test - public void operator_modulo_AtomicLong_byte() throws Exception { - assertEquals(1l, operator_modulo(left, (byte) right)); - } - - @Test - public void operator_modulo_AtomicLong_Byte() throws Exception { - assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_modulo_AtomicLong_float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, (float) right)); - } - - @Test - public void operator_modulo_AtomicLong_Float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); - } - - @Test - public void operator_modulo_AtomicLong_int() throws Exception { - assertEquals(1, operator_modulo(left, (int) right)); - } - - @Test - public void operator_modulo_AtomicLong_Integer() throws Exception { - assertEquals(1, operator_modulo(left, Integer.valueOf(right))); - } - - @Test - public void operator_modulo_AtomicLong_Number() throws Exception { - assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_modulo_AtomicLong_short() throws Exception { - assertEquals(1, operator_modulo(left, (short) right)); - } - - @Test - public void operator_modulo_AtomicLong_Short() throws Exception { - assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); - } - - @Test - public void operator_modulo_AtomicLong_AtomicInteger() throws Exception { - assertEquals(1, operator_modulo(left, new AtomicInteger(right))); - } - - @Test - public void operator_modulo_AtomicLong_AtomicLong() throws Exception { - assertEquals(1l, operator_modulo(left, new AtomicLong(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : long {", - " -left", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left) {", - " return (-(left.longValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicLong_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicLong left, final AtomicDouble right) {", - " return (left.longValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicLong_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final long right) {", - " return (left.longValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicLong_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Long right) {", - " return (left.longValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicLong_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : byte) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final byte right) {", - " return (left.longValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicLong_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Byte) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Byte right) {", - " return (left.longValue() - right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicLong_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicLong left, final float right) {", - " return (left.longValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicLong_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicLong left, final Float right) {", - " return (left.longValue() - right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicLong_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : int) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final int right) {", - " return (left.longValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicLong_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Integer) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Integer right) {", - " return (left.longValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicLong_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : short) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final short right) {", - " return (left.longValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicLong_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Short) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Short right) {", - " return (left.longValue() - right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicLong_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicInteger) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final AtomicInteger right) {", - " return (left.longValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_AtomicLong_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicLong) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final AtomicLong right) {", - " return (left.longValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicLong_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Long right) {", - " return (left.longValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicLong_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final long right) {", - " return (left.longValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicLong_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : byte) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final byte right) {", - " return (left.longValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicLong_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Byte) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Byte right) {", - " return (left.longValue() + right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicLong_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicLong left, final Float right) {", - " return (left.longValue() + right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicLong_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicLong left, final float right) {", - " return (left.longValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicLong_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Integer) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Integer right) {", - " return (left.longValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicLong_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : int) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final int right) {", - " return (left.longValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicLong_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : short) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final short right) {", - " return (left.longValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicLong_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Short) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Short right) {", - " return (left.longValue() + right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicLong_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicInteger) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final AtomicInteger right) {", - " return (left.longValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicLong_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Long right) {", - " return (left.longValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_AtomicLong_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicLong left, final AtomicDouble right) {", - " return (left.longValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicLong_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicLong left, final AtomicDouble right) {", - " return Math.pow(left.longValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicLong_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : byte) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicLong left, final byte right) {", - " return Math.pow(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicLong_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : short) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicLong left, final short right) {", - " return Math.pow(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicLong_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : int) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicLong left, final int right) {", - " return Math.pow(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicLong_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : long) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicLong left, final long right) {", - " return Math.pow(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicLong_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : float) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicLong left, final float right) {", - " return Math.pow(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_AtomicLong_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : double) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicLong left, final double right) {", - " return Math.pow(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicLong_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final long right) {", - " return (left.longValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicLong_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Long right) {", - " return (left.longValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicLong_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : byte) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final byte right) {", - " return (left.longValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicLong_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Byte) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Byte right) {", - " return (left.longValue() / right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicLong_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicLong left, final float right) {", - " return (left.longValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicLong_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicLong left, final Float right) {", - " return (left.longValue() / right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicLong_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : int) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final int right) {", - " return (left.longValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicLong_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Integer) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Integer right) {", - " return (left.longValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicLong_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicLong left, final AtomicDouble right) {", - " return (left.longValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicLong_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : short) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final short right) {", - " return (left.longValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicLong_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Short) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Short right) {", - " return (left.longValue() / right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicLong_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicInteger) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final AtomicInteger right) {", - " return (left.longValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_AtomicLong_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicLong) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final AtomicLong right) {", - " return (left.longValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicLong_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final long right) {", - " return (left.longValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicLong_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Long right) {", - " return (left.longValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicLong_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : byte) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final byte right) {", - " return (left.longValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicLong_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Byte) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Byte right) {", - " return (left.longValue() * right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicLong_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicLong left, final float right) {", - " return (left.longValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicLong_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicLong left, final Float right) {", - " return (left.longValue() * right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicLong_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : int) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final int right) {", - " return (left.longValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicLong_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Integer) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Integer right) {", - " return (left.longValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicLong_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicLong left, final AtomicDouble right) {", - " return (left.longValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicLong_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : short) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final short right) {", - " return (left.longValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicLong_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Short) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Short right) {", - " return (left.longValue() * right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicLong_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicInteger) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final AtomicInteger right) {", - " return (left.longValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_AtomicLong_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicLong) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final AtomicLong right) {", - " return (left.longValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicLong_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final long right) {", - " return (left.longValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicLong_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Long right) {", - " return (left.longValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicLong_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Byte) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Byte right) {", - " return (left.longValue() % right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicLong_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : byte) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final byte right) {", - " return (left.longValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicLong_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicLong left, final float right) {", - " return (left.longValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicLong_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final AtomicLong left, final Float right) {", - " return (left.longValue() % right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicLong_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : int) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final int right) {", - " return (left.longValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicLong_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Integer) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Integer right) {", - " return (left.longValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicLong_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final AtomicLong left, final AtomicDouble right) {", - " return (left.longValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicLong_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : short) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final short right) {", - " return (left.longValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicLong_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : Short) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final Short right) {", - " return (left.longValue() % right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicLong_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicInteger) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final AtomicInteger right) {", - " return (left.longValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_AtomicLong_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong, right : AtomicLong) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final AtomicLong left, final AtomicLong right) {", - " return (left.longValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/ByteArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/ByteArithmeticExtensionsTest.java deleted file mode 100644 index 6ac45dd195..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/ByteArithmeticExtensionsTest.java +++ /dev/null @@ -1,2744 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ByteArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ByteArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ByteArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ByteArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ByteArithmeticExtensions.operator_plus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ByteArithmeticExtensions.operator_power; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - ByteArithmeticExtensionsTest.Code.class, - ByteArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class ByteArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Byte left = 4; - - private static int right = 3; - - @Test - public void operator_minus_Byte() throws Exception { - assertEquals(-4, operator_minus(left)); - } - - @Test - public void operator_minus_Byte_Number() throws Exception { - assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_minus_Byte_long() throws Exception { - assertEquals(1, operator_minus(left, (long) right)); - } - - @Test - public void operator_minus_Byte_Long() throws Exception { - assertEquals(1, operator_minus(left, Long.valueOf(right))); - } - - @Test - public void operator_minus_Byte_byte() throws Exception { - assertEquals(1, operator_minus(left, (byte)right)); - } - - @Test - public void operator_minus_Byte_Byte() throws Exception { - assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); - } - - @Test - public void operator_minus_Byte_float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, (float) right)); - } - - @Test - public void operator_minus_Byte_Float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); - } - - @Test - public void operator_minus_Byte_int() throws Exception { - assertEquals(1, operator_minus(left, (int) right)); - } - - @Test - public void operator_minus_Byte_Integer() throws Exception { - assertEquals(1, operator_minus(left, Integer.valueOf(right))); - } - - @Test - public void operator_minus_Byte_short() throws Exception { - assertEquals(1, operator_minus(left, (short) right)); - } - - @Test - public void operator_minus_Byte_Short() throws Exception { - assertEquals(1, operator_minus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_minus_Byte_AtomicInteger() throws Exception { - assertEquals(1, operator_minus(left, new AtomicInteger(right))); - } - - @Test - public void operator_minus_Byte_AtomicLong() throws Exception { - assertEquals(1l, operator_minus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_Byte_long() throws Exception { - assertEquals(7l, operator_plus(left, (long) right)); - } - - @Test - public void operator_plus_Byte_Long() throws Exception { - assertEquals(7l, operator_plus(left, Long.valueOf(right))); - } - - @Test - public void operator_plus_Byte_byte() throws Exception { - assertEquals(7, operator_plus(left, (byte) right)); - } - - @Test - public void operator_plus_Byte_Byte() throws Exception { - assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_plus_Byte_float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, (float) right)); - } - - @Test - public void operator_plus_Byte_Float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); - } - - @Test - public void operator_plus_Byte_int() throws Exception { - assertEquals(7, operator_plus(left, (int) right)); - } - - @Test - public void operator_plus_Byte_Integer() throws Exception { - assertEquals(7, operator_plus(left, Integer.valueOf(right))); - } - - @Test - public void operator_plus_Byte_short() throws Exception { - assertEquals(7, operator_plus(left, (short) right)); - } - - @Test - public void operator_plus_Byte_Short() throws Exception { - assertEquals(7, operator_plus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_plus_Byte_AtomicInteger() throws Exception { - assertEquals(7, operator_plus(left, new AtomicInteger(right))); - } - - @Test - public void operator_plus_Byte_AtomicLong() throws Exception { - assertEquals(7l, operator_plus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_Byte_Number() throws Exception { - assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_Byte_Number() throws Exception { - assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_power_Byte_byte() throws Exception { - assertEpsilonEquals(64., operator_power(left, (byte) right)); - } - - @Test - public void operator_power_Byte_short() throws Exception { - assertEpsilonEquals(64., operator_power(left, (short) right)); - } - - @Test - public void operator_power_Byte_int() throws Exception { - assertEpsilonEquals(64., operator_power(left, (int) right)); - } - - @Test - public void operator_power_Byte_long() throws Exception { - assertEpsilonEquals(64., operator_power(left, (long) right)); - } - - @Test - public void operator_power_Byte_float() throws Exception { - assertEpsilonEquals(64., operator_power(left, (float) right)); - } - - @Test - public void operator_power_Byte_double() throws Exception { - assertEpsilonEquals(64., operator_power(left, (double) right)); - } - - @Test - public void operator_divide_Byte_long() throws Exception { - assertEquals(1l, operator_divide(left, (long) right)); - } - - @Test - public void operator_divide_Byte_Long() throws Exception { - assertEquals(1l, operator_divide(left, Long.valueOf(right))); - } - - @Test - public void operator_divide_Byte_byte() throws Exception { - assertEquals(1l, operator_divide(left, (byte) right)); - } - - @Test - public void operator_divide_Byte_Byte() throws Exception { - assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_divide_Byte_float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, (float) right)); - } - - @Test - public void operator_divide_Byte_Float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); - } - - @Test - public void operator_divide_Byte_int() throws Exception { - assertEquals(1, operator_divide(left, (int) right)); - } - - @Test - public void operator_divide_Byte_Integer() throws Exception { - assertEquals(1, operator_divide(left, Integer.valueOf(right))); - } - - @Test - public void operator_divide_Byte_Number() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_divide_Byte_short() throws Exception { - assertEquals(1, operator_divide(left, (short) right)); - } - - @Test - public void operator_divide_Byte_Short() throws Exception { - assertEquals(1, operator_divide(left, Short.valueOf((short) right))); - } - - @Test - public void operator_divide_Byte_AtomicInteger() throws Exception { - assertEquals(1, operator_divide(left, new AtomicInteger(right))); - } - - @Test - public void operator_divide_Byte_AtomicLong() throws Exception { - assertEquals(1l, operator_divide(left, new AtomicLong(right))); - } - - @Test - public void operator_multiply_Byte_long() throws Exception { - assertEquals(12l, operator_multiply(left, (long) right)); - } - - @Test - public void operator_multiply_Byte_Long() throws Exception { - assertEquals(12l, operator_multiply(left, Long.valueOf(right))); - } - - @Test - public void operator_multiply_Byte_byte() throws Exception { - assertEquals(12, operator_multiply(left, (byte) right)); - } - - @Test - public void operator_multiply_Byte_Byte() throws Exception { - assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_multiply_Byte_float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, (float) right)); - } - - @Test - public void operator_multiply_Byte_Float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); - } - - @Test - public void operator_multiply_Byte_int() throws Exception { - assertEquals(12, operator_multiply(left, (int) right)); - } - - @Test - public void operator_multiply_Byte_Integer() throws Exception { - assertEquals(12, operator_multiply(left, Integer.valueOf(right))); - } - - @Test - public void operator_multiply_Byte_Number() throws Exception { - assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_multiply_Byte_short() throws Exception { - assertEquals(12, operator_multiply(left, (short) right)); - } - - @Test - public void operator_multiply_Byte_Short() throws Exception { - assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); - } - - @Test - public void operator_multiply_Byte_AtomicInteger() throws Exception { - assertEquals(12, operator_multiply(left, new AtomicInteger(right))); - } - - @Test - public void operator_multiply_Byte_AtomicLong() throws Exception { - assertEquals(12l, operator_multiply(left, new AtomicLong(right))); - } - - @Test - public void operator_modulo_Byte_long() throws Exception { - assertEquals(1l, operator_modulo(left, (long) right)); - } - - @Test - public void operator_modulo_Byte_Long() throws Exception { - assertEquals(1l, operator_modulo(left, Long.valueOf(right))); - } - - @Test - public void operator_modulo_Byte_byte() throws Exception { - assertEquals(1l, operator_modulo(left, (byte) right)); - } - - @Test - public void operator_modulo_Byte_Byte() throws Exception { - assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_modulo_Byte_float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, (float) right)); - } - - @Test - public void operator_modulo_Byte_Float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); - } - - @Test - public void operator_modulo_Byte_int() throws Exception { - assertEquals(1, operator_modulo(left, (int) right)); - } - - @Test - public void operator_modulo_Byte_Integer() throws Exception { - assertEquals(1, operator_modulo(left, Integer.valueOf(right))); - } - - @Test - public void operator_modulo_Byte_Number() throws Exception { - assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_modulo_Byte_short() throws Exception { - assertEquals(1, operator_modulo(left, (short) right)); - } - - @Test - public void operator_modulo_Byte_Short() throws Exception { - assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); - } - - @Test - public void operator_modulo_Byte_AtomicInteger() throws Exception { - assertEquals(1, operator_modulo(left, new AtomicInteger(right))); - } - - @Test - public void operator_modulo_Byte_AtomicLong() throws Exception { - assertEquals(1l, operator_modulo(left, new AtomicLong(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte) : int {", - " -left", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left) {", - " return (-(left.byteValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Byte left, final AtomicDouble right) {", - " return (left.byteValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final long right) {", - " return (left.byteValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final Long right) {", - " return (left.byteValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : byte) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final byte right) {", - " return (left.byteValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Byte) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Byte right) {", - " return (left.byteValue() - right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Byte left, final float right) {", - " return (left.byteValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Byte left, final Float right) {", - " return (left.byteValue() - right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : int) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final int right) {", - " return (left.byteValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Integer) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Integer right) {", - " return (left.byteValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : short) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final short right) {", - " return (left.byteValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Short) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Short right) {", - " return (left.byteValue() - right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Byte, right : AtomicInteger) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final AtomicInteger right) {", - " return (left.byteValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Byte, right : AtomicLong) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final AtomicLong right) {", - " return (left.byteValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final Long right) {", - " return (left.byteValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final long right) {", - " return (left.byteValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : byte) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final byte right) {", - " return (left.byteValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Byte) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Byte right) {", - " return (left.byteValue() + right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Byte left, final Float right) {", - " return (left.byteValue() + right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Byte left, final float right) {", - " return (left.byteValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Integer) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Integer right) {", - " return (left.byteValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : int) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final int right) {", - " return (left.byteValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : short) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final short right) {", - " return (left.byteValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Short) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Short right) {", - " return (left.byteValue() + right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Byte, right : AtomicInteger) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final AtomicInteger right) {", - " return (left.byteValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final Long right) {", - " return (left.byteValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Byte left, final AtomicDouble right) {", - " return (left.byteValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Byte left, final AtomicDouble right) {", - " return Math.pow(left.byteValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : byte) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Byte left, final byte right) {", - " return Math.pow(left.byteValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : short) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Byte left, final short right) {", - " return Math.pow(left.byteValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : int) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Byte left, final int right) {", - " return Math.pow(left.byteValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : long) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Byte left, final long right) {", - " return Math.pow(left.byteValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : float) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Byte left, final float right) {", - " return Math.pow(left.byteValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : double) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Byte left, final double right) {", - " return Math.pow(left.byteValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final long right) {", - " return (left.byteValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final Long right) {", - " return (left.byteValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : byte) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final byte right) {", - " return (left.byteValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Byte) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Byte right) {", - " return (left.byteValue() / right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Byte left, final float right) {", - " return (left.byteValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Byte left, final Float right) {", - " return (left.byteValue() / right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : int) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final int right) {", - " return (left.byteValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Integer) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Integer right) {", - " return (left.byteValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Byte left, final AtomicDouble right) {", - " return (left.byteValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : short) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final short right) {", - " return (left.byteValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Short) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Short right) {", - " return (left.byteValue() / right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Byte, right : AtomicInteger) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final AtomicInteger right) {", - " return (left.byteValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Byte, right : AtomicLong) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final AtomicLong right) {", - " return (left.byteValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final long right) {", - " return (left.byteValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final Long right) {", - " return (left.byteValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : byte) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final byte right) {", - " return (left.byteValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Byte) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Byte right) {", - " return (left.byteValue() * right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Byte left, final float right) {", - " return (left.byteValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Byte left, final Float right) {", - " return (left.byteValue() * right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : int) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final int right) {", - " return (left.byteValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Integer) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Integer right) {", - " return (left.byteValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Byte left, final AtomicDouble right) {", - " return (left.byteValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : short) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final short right) {", - " return (left.byteValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Short) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Short right) {", - " return (left.byteValue() * right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Byte, right : AtomicInteger) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final AtomicInteger right) {", - " return (left.byteValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Byte, right : AtomicLong) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final AtomicLong right) {", - " return (left.byteValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final long right) {", - " return (left.byteValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final Long right) {", - " return (left.byteValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Byte) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Byte right) {", - " return (left.byteValue() % right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : byte) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final byte right) {", - " return (left.byteValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Byte left, final float right) {", - " return (left.byteValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Byte left, final Float right) {", - " return (left.byteValue() % right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : int) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final int right) {", - " return (left.byteValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Integer) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Integer right) {", - " return (left.byteValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Byte left, final AtomicDouble right) {", - " return (left.byteValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : short) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final short right) {", - " return (left.byteValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Short) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Short right) {", - " return (left.byteValue() % right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Byte, right : AtomicInteger) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final AtomicInteger right) {", - " return (left.byteValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Byte, right : AtomicLong) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left, final AtomicLong right) {", - " return (left.byteValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/DoubleArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/DoubleArithmeticExtensionsTest.java deleted file mode 100644 index 5e06d5b21b..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/DoubleArithmeticExtensionsTest.java +++ /dev/null @@ -1,2571 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.DoubleArithmeticExtensions.operator_power; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.DoubleArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.DoubleArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.DoubleArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.DoubleArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.DoubleArithmeticExtensions.operator_plus; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - DoubleArithmeticExtensionsTest.Code.class, - DoubleArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class DoubleArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Double left = Double.valueOf(4); - - private static int right = 3; - - @Test - public void operator_minus_Double_long() throws Exception { - assertEpsilonEquals(1, operator_minus(left, (long) right)); - } - - @Test - public void operator_minus_Double_byte() throws Exception { - assertEpsilonEquals(1, operator_minus(left, (byte)right)); - } - - @Test - public void operator_minus_Double_float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, (float) right)); - } - - @Test - public void operator_minus_Double_int() throws Exception { - assertEpsilonEquals(1, operator_minus(left, (int) right)); - } - - @Test - public void operator_minus_Double_short() throws Exception { - assertEpsilonEquals(1, operator_minus(left, (short) right)); - } - - @Test - public void operator_plus_Double_long() throws Exception { - assertEpsilonEquals(7l, operator_plus(left, (long) right)); - } - - @Test - public void operator_plus_Double_byte() throws Exception { - assertEpsilonEquals(7, operator_plus(left, (byte) right)); - } - - @Test - public void operator_plus_Double_float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, (float) right)); - } - - @Test - public void operator_plus_Double_int() throws Exception { - assertEpsilonEquals(7, operator_plus(left, (int) right)); - } - - @Test - public void operator_plus_Double_short() throws Exception { - assertEpsilonEquals(7, operator_plus(left, (short) right)); - } - - @Test - public void operator_divide_Double_long() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (long) right)); - } - - @Test - public void operator_divide_Double_byte() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (byte) right)); - } - - @Test - public void operator_divide_Double_float() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (float) right)); - } - - @Test - public void operator_divide_Double_int() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (int) right)); - } - - @Test - public void operator_divide_Double_short() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (short) right)); - } - - @Test - public void operator_multiply_Double_long() throws Exception { - assertEpsilonEquals(12l, operator_multiply(left, (long) right)); - } - - @Test - public void operator_multiply_Double_byte() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, (byte) right)); - } - - @Test - public void operator_multiply_Double_float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, (float) right)); - } - - @Test - public void operator_multiply_Double_int() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, (int) right)); - } - - @Test - public void operator_multiply_Double_short() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, (short) right)); - } - - @Test - public void operator_modulo_Double_long() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, (long) right)); - } - - @Test - public void operator_modulo_Double_byte() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, (byte) right)); - } - - @Test - public void operator_modulo_Double_float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, (float) right)); - } - - @Test - public void operator_modulo_Double_int() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, (int) right)); - } - - @Test - public void operator_modulo_Double_short() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, (short) right)); - } - - @Test - public void operator_modulo_Double_Number() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_Double_byte() throws Exception { - assertEpsilonEquals(64., operator_power(left, (byte) right)); - } - - @Test - public void operator_power_Double_short() throws Exception { - assertEpsilonEquals(64., operator_power(left, (short) right)); - } - - @Test - public void operator_power_Double_int() throws Exception { - assertEpsilonEquals(64., operator_power(left, (int) right)); - } - - @Test - public void operator_power_Double_long() throws Exception { - assertEpsilonEquals(64., operator_power(left, (long) right)); - } - - @Test - public void operator_power_Double_float() throws Exception { - assertEpsilonEquals(64., operator_power(left, (float) right)); - } - - @Test - public void operator_power_Double_double() throws Exception { - assertEpsilonEquals(64., operator_power(left, (double) right)); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double) : double {", - " -left", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left) {", - " return DoubleExtensions.operator_minus(left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicDouble right) {", - " return DoubleExtensions.operator_minus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Double_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : long) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final long right) {", - " return (left.doubleValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Long) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Long right) {", - " return DoubleExtensions.operator_minus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Double_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : byte) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final byte right) {", - " return (left.doubleValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Byte) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Byte right) {", - " return DoubleExtensions.operator_minus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Double_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : float) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final float right) {", - " return (left.doubleValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Float) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Float right) {", - " return DoubleExtensions.operator_minus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Double_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : int) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final int right) {", - " return (left.doubleValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Integer) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Integer right) {", - " return DoubleExtensions.operator_minus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Double_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : short) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final short right) {", - " return (left.doubleValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Short) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Short right) {", - " return DoubleExtensions.operator_minus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Double, right : AtomicInteger) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicInteger right) {", - " return DoubleExtensions.operator_minus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Double, right : AtomicLong) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicLong right) {", - " return DoubleExtensions.operator_minus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Long) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Long right) {", - " return DoubleExtensions.operator_plus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Double_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : long) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final long right) {", - " return (left.doubleValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Double_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : byte) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final byte right) {", - " return (left.doubleValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Byte) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Byte right) {", - " return DoubleExtensions.operator_plus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Float) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Float right) {", - " return DoubleExtensions.operator_plus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Double_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : float) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final float right) {", - " return (left.doubleValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Integer) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Integer right) {", - " return DoubleExtensions.operator_plus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Double_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : int) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final int right) {", - " return (left.doubleValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Double_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : short) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final short right) {", - " return (left.doubleValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Short) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Short right) {", - " return DoubleExtensions.operator_plus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Double, right : AtomicInteger) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicInteger right) {", - " return DoubleExtensions.operator_plus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Long) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Long right) {", - " return DoubleExtensions.operator_plus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicDouble right) {", - " return DoubleExtensions.operator_plus(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicDouble right) {", - " return DoubleExtensions.operator_power(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Double_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : byte) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final byte right) {", - " return Math.pow(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Double_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : short) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final short right) {", - " return Math.pow(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Double_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : int) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final int right) {", - " return Math.pow(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Double_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : long) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final long right) {", - " return Math.pow(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Double_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : float) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final float right) {", - " return Math.pow(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Double_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : double) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final double right) {", - " return Math.pow(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Double_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : long) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final long right) {", - " return (left.doubleValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Long) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Long right) {", - " return DoubleExtensions.operator_divide(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Double_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : byte) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final byte right) {", - " return (left.doubleValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Byte) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Byte right) {", - " return DoubleExtensions.operator_divide(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Double_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : float) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final float right) {", - " return (left.doubleValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Float) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Float right) {", - " return DoubleExtensions.operator_divide(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Double_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : int) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final int right) {", - " return (left.doubleValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Integer) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Integer right) {", - " return DoubleExtensions.operator_divide(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicDouble right) {", - " return DoubleExtensions.operator_divide(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Double_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : short) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final short right) {", - " return (left.doubleValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Short) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Short right) {", - " return DoubleExtensions.operator_divide(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Double, right : AtomicInteger) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicInteger right) {", - " return DoubleExtensions.operator_divide(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Double, right : AtomicLong) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicLong right) {", - " return DoubleExtensions.operator_divide(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Double_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : long) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final long right) {", - " return (left.doubleValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Long) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Long right) {", - " return DoubleExtensions.operator_multiply(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Double_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : byte) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final byte right) {", - " return (left.doubleValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Byte) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Byte right) {", - " return DoubleExtensions.operator_multiply(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Double_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : float) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final float right) {", - " return (left.doubleValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Float) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Float right) {", - " return DoubleExtensions.operator_multiply(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Double_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : int) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final int right) {", - " return (left.doubleValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Integer) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Integer right) {", - " return DoubleExtensions.operator_multiply(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicDouble right) {", - " return DoubleExtensions.operator_multiply(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Double_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : short) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final short right) {", - " return (left.doubleValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Short) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Short right) {", - " return DoubleExtensions.operator_multiply(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Double, right : AtomicInteger) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicInteger right) {", - " return DoubleExtensions.operator_multiply(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Double, right : AtomicLong) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicLong right) {", - " return DoubleExtensions.operator_multiply(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Double_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : long) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final long right) {", - " return (left.doubleValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Long) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Long right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Byte) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Byte right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Double_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : byte) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final byte right) {", - " return (left.doubleValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Double_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : float) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final float right) {", - " return (left.doubleValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Float) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Float right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Double_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : int) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final int right) {", - " return (left.doubleValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Integer) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Integer right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicDouble right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Double_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : short) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final short right) {", - " return (left.doubleValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Short) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final Short right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Double, right : AtomicInteger) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicInteger right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Double, right : AtomicLong) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left, final AtomicLong right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/FloatArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/FloatArithmeticExtensionsTest.java deleted file mode 100644 index 69ae3b0e31..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/FloatArithmeticExtensionsTest.java +++ /dev/null @@ -1,2746 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions.operator_power; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions.operator_plus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions.operator_power; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - FloatArithmeticExtensionsTest.Code.class, - FloatArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class FloatArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Float left = Float.valueOf(4); - - private static int right = 3; - - @Test - public void operator_minus_Float() throws Exception { - assertEpsilonEquals(-4, operator_minus(left)); - } - - @Test - public void operator_minus_Float_Number() throws Exception { - assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_minus_Float_long() throws Exception { - assertEpsilonEquals(1, operator_minus(left, (long) right)); - } - - @Test - public void operator_minus_Float_Long() throws Exception { - assertEpsilonEquals(1, operator_minus(left, Long.valueOf(right))); - } - - @Test - public void operator_minus_Float_byte() throws Exception { - assertEpsilonEquals(1, operator_minus(left, (byte)right)); - } - - @Test - public void operator_minus_Float_Byte() throws Exception { - assertEpsilonEquals(1, operator_minus(left, Byte.valueOf((byte)right))); - } - - @Test - public void operator_minus_Float_float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, (float) right)); - } - - @Test - public void operator_minus_Float_Float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); - } - - @Test - public void operator_minus_Float_int() throws Exception { - assertEpsilonEquals(1, operator_minus(left, (int) right)); - } - - @Test - public void operator_minus_Float_Integer() throws Exception { - assertEpsilonEquals(1, operator_minus(left, Integer.valueOf(right))); - } - - @Test - public void operator_minus_Float_short() throws Exception { - assertEpsilonEquals(1, operator_minus(left, (short) right)); - } - - @Test - public void operator_minus_Float_Short() throws Exception { - assertEpsilonEquals(1, operator_minus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_minus_Float_AtomicInteger() throws Exception { - assertEpsilonEquals(1, operator_minus(left, new AtomicInteger(right))); - } - - @Test - public void operator_minus_Float_AtomicLong() throws Exception { - assertEpsilonEquals(1l, operator_minus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_Float_long() throws Exception { - assertEpsilonEquals(7l, operator_plus(left, (long) right)); - } - - @Test - public void operator_plus_Float_Long() throws Exception { - assertEpsilonEquals(7l, operator_plus(left, Long.valueOf(right))); - } - - @Test - public void operator_plus_Float_byte() throws Exception { - assertEpsilonEquals(7, operator_plus(left, (byte) right)); - } - - @Test - public void operator_plus_Float_Byte() throws Exception { - assertEpsilonEquals(7, operator_plus(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_plus_Float_float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, (float) right)); - } - - @Test - public void operator_plus_Float_Float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); - } - - @Test - public void operator_plus_Float_int() throws Exception { - assertEpsilonEquals(7, operator_plus(left, (int) right)); - } - - @Test - public void operator_plus_Float_Integer() throws Exception { - assertEpsilonEquals(7, operator_plus(left, Integer.valueOf(right))); - } - - @Test - public void operator_plus_Float_short() throws Exception { - assertEpsilonEquals(7, operator_plus(left, (short) right)); - } - - @Test - public void operator_plus_Float_Short() throws Exception { - assertEpsilonEquals(7, operator_plus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_plus_Float_AtomicInteger() throws Exception { - assertEpsilonEquals(7, operator_plus(left, new AtomicInteger(right))); - } - - @Test - public void operator_plus_Float_AtomicLong() throws Exception { - assertEpsilonEquals(7l, operator_plus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_Float_Number() throws Exception { - assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_Float_Number() throws Exception { - assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_power_Float_byte() throws Exception { - assertEpsilonEquals(64., operator_power(left, (byte) right)); - } - - @Test - public void operator_power_Float_short() throws Exception { - assertEpsilonEquals(64., operator_power(left, (short) right)); - } - - @Test - public void operator_power_Float_int() throws Exception { - assertEpsilonEquals(64., operator_power(left, (int) right)); - } - - @Test - public void operator_power_Float_long() throws Exception { - assertEpsilonEquals(64., operator_power(left, (long) right)); - } - - @Test - public void operator_power_Float_float() throws Exception { - assertEpsilonEquals(64., operator_power(left, (float) right)); - } - - @Test - public void operator_power_Float_double() throws Exception { - assertEpsilonEquals(64., operator_power(left, (double) right)); - } - - @Test - public void operator_divide_Float_long() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (long) right)); - } - - @Test - public void operator_divide_Float_Long() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Long.valueOf(right))); - } - - @Test - public void operator_divide_Float_byte() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (byte) right)); - } - - @Test - public void operator_divide_Float_Byte() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_divide_Float_float() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (float) right)); - } - - @Test - public void operator_divide_Float_Float() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Float.valueOf(right))); - } - - @Test - public void operator_divide_Float_int() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (int) right)); - } - - @Test - public void operator_divide_Float_Integer() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Integer.valueOf(right))); - } - - @Test - public void operator_divide_Float_Number() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_divide_Float_short() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (short) right)); - } - - @Test - public void operator_divide_Float_Short() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Short.valueOf((short) right))); - } - - @Test - public void operator_divide_Float_AtomicInteger() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, new AtomicInteger(right))); - } - - @Test - public void operator_divide_Float_AtomicLong() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, new AtomicLong(right))); - } - - @Test - public void operator_multiply_Float_long() throws Exception { - assertEpsilonEquals(12l, operator_multiply(left, (long) right)); - } - - @Test - public void operator_multiply_Float_Long() throws Exception { - assertEpsilonEquals(12l, operator_multiply(left, Long.valueOf(right))); - } - - @Test - public void operator_multiply_Float_byte() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, (byte) right)); - } - - @Test - public void operator_multiply_Float_Byte() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_multiply_Float_float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, (float) right)); - } - - @Test - public void operator_multiply_Float_Float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); - } - - @Test - public void operator_multiply_Float_int() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, (int) right)); - } - - @Test - public void operator_multiply_Float_Integer() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, Integer.valueOf(right))); - } - - @Test - public void operator_multiply_Float_Number() throws Exception { - assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_multiply_Float_short() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, (short) right)); - } - - @Test - public void operator_multiply_Float_Short() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, Short.valueOf((short) right))); - } - - @Test - public void operator_multiply_Float_AtomicInteger() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, new AtomicInteger(right))); - } - - @Test - public void operator_multiply_Float_AtomicLong() throws Exception { - assertEpsilonEquals(12l, operator_multiply(left, new AtomicLong(right))); - } - - @Test - public void operator_modulo_Float_long() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, (long) right)); - } - - @Test - public void operator_modulo_Float_Long() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, Long.valueOf(right))); - } - - @Test - public void operator_modulo_Float_byte() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, (byte) right)); - } - - @Test - public void operator_modulo_Float_Byte() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_modulo_Float_float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, (float) right)); - } - - @Test - public void operator_modulo_Float_Float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); - } - - @Test - public void operator_modulo_Float_int() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, (int) right)); - } - - @Test - public void operator_modulo_Float_Integer() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, Integer.valueOf(right))); - } - - @Test - public void operator_modulo_Float_Number() throws Exception { - assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_modulo_Float_short() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, (short) right)); - } - - @Test - public void operator_modulo_Float_Short() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, Short.valueOf((short) right))); - } - - @Test - public void operator_modulo_Float_AtomicInteger() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, new AtomicInteger(right))); - } - - @Test - public void operator_modulo_Float_AtomicLong() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, new AtomicLong(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float) : float {", - " -left", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left) {", - " return (-(left.floatValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Float_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Float left, final AtomicDouble right) {", - " return (left.floatValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Float_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : long) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final long right) {", - " return (left.floatValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Float_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Long) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Long right) {", - " return (left.floatValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Float_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : byte) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final byte right) {", - " return (left.floatValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Float_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Byte) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Byte right) {", - " return (left.floatValue() - right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Float_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final float right) {", - " return (left.floatValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Float_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Float right) {", - " return (left.floatValue() - right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Float_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : int) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final int right) {", - " return (left.floatValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Float_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Integer) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Integer right) {", - " return (left.floatValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Float_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : short) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final short right) {", - " return (left.floatValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Float_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Short) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Short right) {", - " return (left.floatValue() - right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Float_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Float, right : AtomicInteger) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final AtomicInteger right) {", - " return (left.floatValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Float_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Float, right : AtomicLong) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final AtomicLong right) {", - " return (left.floatValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Float_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Long) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Long right) {", - " return (left.floatValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Float_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : long) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final long right) {", - " return (left.floatValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Float_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : byte) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final byte right) {", - " return (left.floatValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Float_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Byte) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Byte right) {", - " return (left.floatValue() + right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Float_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Float right) {", - " return (left.floatValue() + right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Float_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final float right) {", - " return (left.floatValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Float_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Integer) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Integer right) {", - " return (left.floatValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Float_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : int) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final int right) {", - " return (left.floatValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Float_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : short) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final short right) {", - " return (left.floatValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Float_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Short) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Short right) {", - " return (left.floatValue() + right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Float_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Float, right : AtomicInteger) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final AtomicInteger right) {", - " return (left.floatValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Float_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Long) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Long right) {", - " return (left.floatValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Float_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Float left, final AtomicDouble right) {", - " return (left.floatValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Float_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Float left, final AtomicDouble right) {", - " return Math.pow(left.floatValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Float_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : byte) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Float left, final byte right) {", - " return Math.pow(left.floatValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Float_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : short) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Float left, final short right) {", - " return Math.pow(left.floatValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Float_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : int) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Float left, final int right) {", - " return Math.pow(left.floatValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Float_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : long) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Float left, final long right) {", - " return Math.pow(left.floatValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Float_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : float) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Float left, final float right) {", - " return Math.pow(left.floatValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Float_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : double) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Float left, final double right) {", - " return Math.pow(left.floatValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Float_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : long) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final long right) {", - " return (left.floatValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Float_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Long) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Long right) {", - " return (left.floatValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Float_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : byte) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final byte right) {", - " return (left.floatValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Float_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Byte) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Byte right) {", - " return (left.floatValue() / right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Float_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final float right) {", - " return (left.floatValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Float_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Float right) {", - " return (left.floatValue() / right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Float_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : int) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final int right) {", - " return (left.floatValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Float_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Integer) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Integer right) {", - " return (left.floatValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Float_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Float left, final AtomicDouble right) {", - " return (left.floatValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Float_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : short) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final short right) {", - " return (left.floatValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Float_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Short) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Short right) {", - " return (left.floatValue() / right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Float_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Float, right : AtomicInteger) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final AtomicInteger right) {", - " return (left.floatValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Float_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Float, right : AtomicLong) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final AtomicLong right) {", - " return (left.floatValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Float_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : long) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final long right) {", - " return (left.floatValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Float_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Long) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Long right) {", - " return (left.floatValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Float_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : byte) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final byte right) {", - " return (left.floatValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Float_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Byte) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Byte right) {", - " return (left.floatValue() * right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Float_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final float right) {", - " return (left.floatValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Float_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Float right) {", - " return (left.floatValue() * right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Float_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : int) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final int right) {", - " return (left.floatValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Float_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Integer) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Integer right) {", - " return (left.floatValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Float_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Float left, final AtomicDouble right) {", - " return (left.floatValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Float_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : short) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final short right) {", - " return (left.floatValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Float_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Short) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Short right) {", - " return (left.floatValue() * right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Float_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Float, right : AtomicInteger) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final AtomicInteger right) {", - " return (left.floatValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Float_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Float, right : AtomicLong) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final AtomicLong right) {", - " return (left.floatValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Float_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : long) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final long right) {", - " return (left.floatValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Float_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Long) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Long right) {", - " return (left.floatValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Float_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Byte) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Byte right) {", - " return (left.floatValue() % right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Float_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : byte) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final byte right) {", - " return (left.floatValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Float_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final float right) {", - " return (left.floatValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Float_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Float right) {", - " return (left.floatValue() % right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Float_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : int) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final int right) {", - " return (left.floatValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Float_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Integer) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Integer right) {", - " return (left.floatValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Float_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Float left, final AtomicDouble right) {", - " return (left.floatValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Float_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : short) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final short right) {", - " return (left.floatValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Float_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Short) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final Short right) {", - " return (left.floatValue() % right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Float_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Float, right : AtomicInteger) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final AtomicInteger right) {", - " return (left.floatValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Float_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Float, right : AtomicLong) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left, final AtomicLong right) {", - " return (left.floatValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/IntegerArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/IntegerArithmeticExtensionsTest.java deleted file mode 100644 index 889c02d58c..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/IntegerArithmeticExtensionsTest.java +++ /dev/null @@ -1,2747 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions.operator_power; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions.operator_plus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions.operator_power; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - IntegerArithmeticExtensionsTest.Code.class, - IntegerArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class IntegerArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Integer left = 4; - - private static int right = 3; - - @Test - public void operator_minus_Integer() throws Exception { - assertEquals(-4, operator_minus(left)); - } - - @Test - public void operator_minus_Integer_Number() throws Exception { - assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_minus_Integer_long() throws Exception { - assertEquals(1, operator_minus(left, (long) right)); - } - - @Test - public void operator_minus_Integer_Long() throws Exception { - assertEquals(1, operator_minus(left, Long.valueOf(right))); - } - - @Test - public void operator_minus_Integer_byte() throws Exception { - assertEquals(1, operator_minus(left, (byte)right)); - } - - @Test - public void operator_minus_Integer_Byte() throws Exception { - assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); - } - - @Test - public void operator_minus_Integer_float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, (float) right)); - } - - @Test - public void operator_minus_Integer_Float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); - } - - @Test - public void operator_minus_Integer_int() throws Exception { - assertEquals(1, operator_minus(left, (int) right)); - } - - @Test - public void operator_minus_Integer_Integer() throws Exception { - assertEquals(1, operator_minus(left, Integer.valueOf(right))); - } - - @Test - public void operator_minus_Integer_short() throws Exception { - assertEquals(1, operator_minus(left, (short) right)); - } - - @Test - public void operator_minus_Integer_Short() throws Exception { - assertEquals(1, operator_minus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_minus_Integer_AtomicInteger() throws Exception { - assertEquals(1, operator_minus(left, new AtomicInteger(right))); - } - - @Test - public void operator_minus_Integer_AtomicLong() throws Exception { - assertEquals(1l, operator_minus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_Integer_long() throws Exception { - assertEquals(7l, operator_plus(left, (long) right)); - } - - @Test - public void operator_plus_Integer_Long() throws Exception { - assertEquals(7l, operator_plus(left, Long.valueOf(right))); - } - - @Test - public void operator_plus_Integer_byte() throws Exception { - assertEquals(7, operator_plus(left, (byte) right)); - } - - @Test - public void operator_plus_Integer_Byte() throws Exception { - assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_plus_Integer_float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, (float) right)); - } - - @Test - public void operator_plus_Integer_Float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); - } - - @Test - public void operator_plus_Integer_int() throws Exception { - assertEquals(7, operator_plus(left, (int) right)); - } - - @Test - public void operator_plus_Integer_Integer() throws Exception { - assertEquals(7, operator_plus(left, Integer.valueOf(right))); - } - - @Test - public void operator_plus_Integer_short() throws Exception { - assertEquals(7, operator_plus(left, (short) right)); - } - - @Test - public void operator_plus_Integer_Short() throws Exception { - assertEquals(7, operator_plus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_plus_Integer_AtomicInteger() throws Exception { - assertEquals(7, operator_plus(left, new AtomicInteger(right))); - } - - @Test - public void operator_plus_Integer_AtomicLong() throws Exception { - assertEquals(7l, operator_plus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_Integer_Number() throws Exception { - assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_Integer_Number() throws Exception { - assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); - } - - - @Test - public void operator_power_Integer_byte() throws Exception { - assertEpsilonEquals(64., operator_power(left, (byte) right)); - } - - @Test - public void operator_power_Integer_short() throws Exception { - assertEpsilonEquals(64., operator_power(left, (short) right)); - } - - @Test - public void operator_power_Integer_int() throws Exception { - assertEpsilonEquals(64., operator_power(left, (int) right)); - } - - @Test - public void operator_power_Integer_long() throws Exception { - assertEpsilonEquals(64., operator_power(left, (long) right)); - } - - @Test - public void operator_power_Integer_float() throws Exception { - assertEpsilonEquals(64., operator_power(left, (float) right)); - } - - @Test - public void operator_power_Integer_double() throws Exception { - assertEpsilonEquals(64., operator_power(left, (double) right)); - } - - @Test - public void operator_divide_Integer_long() throws Exception { - assertEquals(1l, operator_divide(left, (long) right)); - } - - @Test - public void operator_divide_Integer_Long() throws Exception { - assertEquals(1l, operator_divide(left, Long.valueOf(right))); - } - - @Test - public void operator_divide_Integer_byte() throws Exception { - assertEquals(1l, operator_divide(left, (byte) right)); - } - - @Test - public void operator_divide_Integer_Byte() throws Exception { - assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_divide_Integer_float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, (float) right)); - } - - @Test - public void operator_divide_Integer_Float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); - } - - @Test - public void operator_divide_Integer_int() throws Exception { - assertEquals(1, operator_divide(left, (int) right)); - } - - @Test - public void operator_divide_Integer_Integer() throws Exception { - assertEquals(1, operator_divide(left, Integer.valueOf(right))); - } - - @Test - public void operator_divide_Integer_Number() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_divide_Integer_short() throws Exception { - assertEquals(1, operator_divide(left, (short) right)); - } - - @Test - public void operator_divide_Integer_Short() throws Exception { - assertEquals(1, operator_divide(left, Short.valueOf((short) right))); - } - - @Test - public void operator_divide_Integer_AtomicInteger() throws Exception { - assertEquals(1, operator_divide(left, new AtomicInteger(right))); - } - - @Test - public void operator_divide_Integer_AtomicLong() throws Exception { - assertEquals(1l, operator_divide(left, new AtomicLong(right))); - } - - @Test - public void operator_multiply_Integer_long() throws Exception { - assertEquals(12l, operator_multiply(left, (long) right)); - } - - @Test - public void operator_multiply_Integer_Long() throws Exception { - assertEquals(12l, operator_multiply(left, Long.valueOf(right))); - } - - @Test - public void operator_multiply_Integer_byte() throws Exception { - assertEquals(12, operator_multiply(left, (byte) right)); - } - - @Test - public void operator_multiply_Integer_Byte() throws Exception { - assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_multiply_Integer_float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, (float) right)); - } - - @Test - public void operator_multiply_Integer_Float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); - } - - @Test - public void operator_multiply_Integer_int() throws Exception { - assertEquals(12, operator_multiply(left, (int) right)); - } - - @Test - public void operator_multiply_Integer_Integer() throws Exception { - assertEquals(12, operator_multiply(left, Integer.valueOf(right))); - } - - @Test - public void operator_multiply_Integer_Number() throws Exception { - assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_multiply_Integer_short() throws Exception { - assertEquals(12, operator_multiply(left, (short) right)); - } - - @Test - public void operator_multiply_Integer_Short() throws Exception { - assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); - } - - @Test - public void operator_multiply_Integer_AtomicInteger() throws Exception { - assertEquals(12, operator_multiply(left, new AtomicInteger(right))); - } - - @Test - public void operator_multiply_Integer_AtomicLong() throws Exception { - assertEquals(12l, operator_multiply(left, new AtomicLong(right))); - } - - @Test - public void operator_modulo_Integer_long() throws Exception { - assertEquals(1l, operator_modulo(left, (long) right)); - } - - @Test - public void operator_modulo_Integer_Long() throws Exception { - assertEquals(1l, operator_modulo(left, Long.valueOf(right))); - } - - @Test - public void operator_modulo_Integer_byte() throws Exception { - assertEquals(1l, operator_modulo(left, (byte) right)); - } - - @Test - public void operator_modulo_Integer_Byte() throws Exception { - assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_modulo_Integer_float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, (float) right)); - } - - @Test - public void operator_modulo_Integer_Float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); - } - - @Test - public void operator_modulo_Integer_int() throws Exception { - assertEquals(1, operator_modulo(left, (int) right)); - } - - @Test - public void operator_modulo_Integer_Integer() throws Exception { - assertEquals(1, operator_modulo(left, Integer.valueOf(right))); - } - - @Test - public void operator_modulo_Integer_Number() throws Exception { - assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_modulo_Integer_short() throws Exception { - assertEquals(1, operator_modulo(left, (short) right)); - } - - @Test - public void operator_modulo_Integer_Short() throws Exception { - assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); - } - - @Test - public void operator_modulo_Integer_AtomicInteger() throws Exception { - assertEquals(1, operator_modulo(left, new AtomicInteger(right))); - } - - @Test - public void operator_modulo_Integer_AtomicLong() throws Exception { - assertEquals(1l, operator_modulo(left, new AtomicLong(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer) : int {", - " -left", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left) {", - " return (-(left.intValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Integer_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Integer left, final AtomicDouble right) {", - " return (left.intValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Integer_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final long right) {", - " return (left.intValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Integer_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final Long right) {", - " return (left.intValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Integer_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : byte) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final byte right) {", - " return (left.intValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Integer_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Byte) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Byte right) {", - " return (left.intValue() - right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Integer_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Integer left, final float right) {", - " return (left.intValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Integer_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Integer left, final Float right) {", - " return (left.intValue() - right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Integer_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : int) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final int right) {", - " return (left.intValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Integer_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Integer) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Integer right) {", - " return (left.intValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Integer_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : short) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final short right) {", - " return (left.intValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Integer_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Short) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Short right) {", - " return (left.intValue() - right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Integer_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Integer, right : AtomicInteger) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final AtomicInteger right) {", - " return (left.intValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Integer_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Integer, right : AtomicLong) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final AtomicLong right) {", - " return (left.intValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Integer_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final Long right) {", - " return (left.intValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Integer_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final long right) {", - " return (left.intValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Integer_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : byte) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final byte right) {", - " return (left.intValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Integer_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Byte) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Byte right) {", - " return (left.intValue() + right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Integer_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Integer left, final Float right) {", - " return (left.intValue() + right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Integer_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Integer left, final float right) {", - " return (left.intValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Integer_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Integer) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Integer right) {", - " return (left.intValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Integer_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : int) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final int right) {", - " return (left.intValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Integer_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : short) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final short right) {", - " return (left.intValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Integer_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Short) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Short right) {", - " return (left.intValue() + right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Integer_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Integer, right : AtomicInteger) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final AtomicInteger right) {", - " return (left.intValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Integer_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final Long right) {", - " return (left.intValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Integer_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Integer left, final AtomicDouble right) {", - " return (left.intValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Integer_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Integer left, final AtomicDouble right) {", - " return Math.pow(left.intValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Integer_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : byte) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Integer left, final byte right) {", - " return Math.pow(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Integer_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : short) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Integer left, final short right) {", - " return Math.pow(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Integer_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : int) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Integer left, final int right) {", - " return Math.pow(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Integer_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : long) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Integer left, final long right) {", - " return Math.pow(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Integer_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : float) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Integer left, final float right) {", - " return Math.pow(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Integer_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : double) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Integer left, final double right) {", - " return Math.pow(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Integer_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final long right) {", - " return (left.intValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Integer_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final Long right) {", - " return (left.intValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Integer_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : byte) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final byte right) {", - " return (left.intValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Integer_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Byte) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Byte right) {", - " return (left.intValue() / right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Integer_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Integer left, final float right) {", - " return (left.intValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Integer_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Integer left, final Float right) {", - " return (left.intValue() / right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Integer_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : int) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final int right) {", - " return (left.intValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Integer_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Integer) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Integer right) {", - " return (left.intValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Integer_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Integer left, final AtomicDouble right) {", - " return (left.intValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Integer_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : short) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final short right) {", - " return (left.intValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Integer_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Short) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Short right) {", - " return (left.intValue() / right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Integer_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Integer, right : AtomicInteger) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final AtomicInteger right) {", - " return (left.intValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Integer_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Integer, right : AtomicLong) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final AtomicLong right) {", - " return (left.intValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Integer_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final long right) {", - " return (left.intValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Integer_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final Long right) {", - " return (left.intValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Integer_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : byte) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final byte right) {", - " return (left.intValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Integer_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Byte) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Byte right) {", - " return (left.intValue() * right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Integer_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Integer left, final float right) {", - " return (left.intValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Integer_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Integer left, final Float right) {", - " return (left.intValue() * right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Integer_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : int) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final int right) {", - " return (left.intValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Integer_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Integer) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Integer right) {", - " return (left.intValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Integer_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Integer left, final AtomicDouble right) {", - " return (left.intValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Integer_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : short) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final short right) {", - " return (left.intValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Integer_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Short) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Short right) {", - " return (left.intValue() * right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Integer_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Integer, right : AtomicInteger) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final AtomicInteger right) {", - " return (left.intValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Integer_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Integer, right : AtomicLong) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final AtomicLong right) {", - " return (left.intValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Integer_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final long right) {", - " return (left.intValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Integer_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final Long right) {", - " return (left.intValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Integer_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Byte) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Byte right) {", - " return (left.intValue() % right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Integer_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : byte) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final byte right) {", - " return (left.intValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Integer_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Integer left, final float right) {", - " return (left.intValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Integer_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Integer left, final Float right) {", - " return (left.intValue() % right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Integer_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : int) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final int right) {", - " return (left.intValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Integer_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Integer) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Integer right) {", - " return (left.intValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Integer_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Integer left, final AtomicDouble right) {", - " return (left.intValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Integer_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : short) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final short right) {", - " return (left.intValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Integer_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Short) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Short right) {", - " return (left.intValue() % right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Integer_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Integer, right : AtomicInteger) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final AtomicInteger right) {", - " return (left.intValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Integer_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Integer, right : AtomicLong) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left, final AtomicLong right) {", - " return (left.intValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/LongArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/LongArithmeticExtensionsTest.java deleted file mode 100644 index 5105d84f12..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/LongArithmeticExtensionsTest.java +++ /dev/null @@ -1,2746 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions.operator_power; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions.operator_plus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions.operator_power; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - LongArithmeticExtensionsTest.Code.class, - LongArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class LongArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Long left = Long.valueOf(4); - - private static int right = 3; - - @Test - public void operator_minus_Long() throws Exception { - assertEquals(-4, operator_minus(left)); - } - - @Test - public void operator_minus_Long_Number() throws Exception { - assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_minus_Long_long() throws Exception { - assertEquals(1, operator_minus(left, (long) right)); - } - - @Test - public void operator_minus_Long_Long() throws Exception { - assertEquals(1, operator_minus(left, Long.valueOf(right))); - } - - @Test - public void operator_minus_Long_byte() throws Exception { - assertEquals(1, operator_minus(left, (byte)right)); - } - - @Test - public void operator_minus_Long_Byte() throws Exception { - assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); - } - - @Test - public void operator_minus_Long_float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, (float) right)); - } - - @Test - public void operator_minus_Long_Float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); - } - - @Test - public void operator_minus_Long_int() throws Exception { - assertEquals(1, operator_minus(left, (int) right)); - } - - @Test - public void operator_minus_Long_Integer() throws Exception { - assertEquals(1, operator_minus(left, Integer.valueOf(right))); - } - - @Test - public void operator_minus_Long_short() throws Exception { - assertEquals(1, operator_minus(left, (short) right)); - } - - @Test - public void operator_minus_Long_Short() throws Exception { - assertEquals(1, operator_minus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_minus_Long_AtomicInteger() throws Exception { - assertEquals(1, operator_minus(left, new AtomicInteger(right))); - } - - @Test - public void operator_minus_Long_AtomicLong() throws Exception { - assertEquals(1l, operator_minus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_Long_long() throws Exception { - assertEquals(7l, operator_plus(left, (long) right)); - } - - @Test - public void operator_plus_Long_Long() throws Exception { - assertEquals(7l, operator_plus(left, Long.valueOf(right))); - } - - @Test - public void operator_plus_Long_byte() throws Exception { - assertEquals(7, operator_plus(left, (byte) right)); - } - - @Test - public void operator_plus_Long_Byte() throws Exception { - assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_plus_Long_float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, (float) right)); - } - - @Test - public void operator_plus_Long_Float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); - } - - @Test - public void operator_plus_Long_int() throws Exception { - assertEquals(7, operator_plus(left, (int) right)); - } - - @Test - public void operator_plus_Long_Integer() throws Exception { - assertEquals(7, operator_plus(left, Integer.valueOf(right))); - } - - @Test - public void operator_plus_Long_short() throws Exception { - assertEquals(7, operator_plus(left, (short) right)); - } - - @Test - public void operator_plus_Long_Short() throws Exception { - assertEquals(7, operator_plus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_plus_Long_AtomicInteger() throws Exception { - assertEquals(7, operator_plus(left, new AtomicInteger(right))); - } - - @Test - public void operator_plus_Long_AtomicLong() throws Exception { - assertEquals(7l, operator_plus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_Long_Number() throws Exception { - assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_Long_Number() throws Exception { - assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_power_Long_byte() throws Exception { - assertEpsilonEquals(64., operator_power(left, (byte) right)); - } - - @Test - public void operator_power_Long_short() throws Exception { - assertEpsilonEquals(64., operator_power(left, (short) right)); - } - - @Test - public void operator_power_Long_int() throws Exception { - assertEpsilonEquals(64., operator_power(left, (int) right)); - } - - @Test - public void operator_power_Long_long() throws Exception { - assertEpsilonEquals(64., operator_power(left, (long) right)); - } - - @Test - public void operator_power_Long_float() throws Exception { - assertEpsilonEquals(64., operator_power(left, (float) right)); - } - - @Test - public void operator_power_Long_double() throws Exception { - assertEpsilonEquals(64., operator_power(left, (double) right)); - } - - @Test - public void operator_divide_Long_long() throws Exception { - assertEquals(1l, operator_divide(left, (long) right)); - } - - @Test - public void operator_divide_Long_Long() throws Exception { - assertEquals(1l, operator_divide(left, Long.valueOf(right))); - } - - @Test - public void operator_divide_Long_byte() throws Exception { - assertEquals(1l, operator_divide(left, (byte) right)); - } - - @Test - public void operator_divide_Long_Byte() throws Exception { - assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_divide_Long_float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, (float) right)); - } - - @Test - public void operator_divide_Long_Float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); - } - - @Test - public void operator_divide_Long_int() throws Exception { - assertEquals(1, operator_divide(left, (int) right)); - } - - @Test - public void operator_divide_Long_Integer() throws Exception { - assertEquals(1, operator_divide(left, Integer.valueOf(right))); - } - - @Test - public void operator_divide_Long_Number() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_divide_Long_short() throws Exception { - assertEquals(1, operator_divide(left, (short) right)); - } - - @Test - public void operator_divide_Long_Short() throws Exception { - assertEquals(1, operator_divide(left, Short.valueOf((short) right))); - } - - @Test - public void operator_divide_Long_AtomicInteger() throws Exception { - assertEquals(1, operator_divide(left, new AtomicInteger(right))); - } - - @Test - public void operator_divide_Long_AtomicLong() throws Exception { - assertEquals(1l, operator_divide(left, new AtomicLong(right))); - } - - @Test - public void operator_multiply_Long_long() throws Exception { - assertEquals(12l, operator_multiply(left, (long) right)); - } - - @Test - public void operator_multiply_Long_Long() throws Exception { - assertEquals(12l, operator_multiply(left, Long.valueOf(right))); - } - - @Test - public void operator_multiply_Long_byte() throws Exception { - assertEquals(12, operator_multiply(left, (byte) right)); - } - - @Test - public void operator_multiply_Long_Byte() throws Exception { - assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_multiply_Long_float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, (float) right)); - } - - @Test - public void operator_multiply_Long_Float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); - } - - @Test - public void operator_multiply_Long_int() throws Exception { - assertEquals(12, operator_multiply(left, (int) right)); - } - - @Test - public void operator_multiply_Long_Integer() throws Exception { - assertEquals(12, operator_multiply(left, Integer.valueOf(right))); - } - - @Test - public void operator_multiply_Long_Number() throws Exception { - assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_multiply_Long_short() throws Exception { - assertEquals(12, operator_multiply(left, (short) right)); - } - - @Test - public void operator_multiply_Long_Short() throws Exception { - assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); - } - - @Test - public void operator_multiply_Long_AtomicInteger() throws Exception { - assertEquals(12, operator_multiply(left, new AtomicInteger(right))); - } - - @Test - public void operator_multiply_Long_AtomicLong() throws Exception { - assertEquals(12l, operator_multiply(left, new AtomicLong(right))); - } - - @Test - public void operator_modulo_Long_long() throws Exception { - assertEquals(1l, operator_modulo(left, (long) right)); - } - - @Test - public void operator_modulo_Long_Long() throws Exception { - assertEquals(1l, operator_modulo(left, Long.valueOf(right))); - } - - @Test - public void operator_modulo_Long_byte() throws Exception { - assertEquals(1l, operator_modulo(left, (byte) right)); - } - - @Test - public void operator_modulo_Long_Byte() throws Exception { - assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_modulo_Long_float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, (float) right)); - } - - @Test - public void operator_modulo_Long_Float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); - } - - @Test - public void operator_modulo_Long_int() throws Exception { - assertEquals(1, operator_modulo(left, (int) right)); - } - - @Test - public void operator_modulo_Long_Integer() throws Exception { - assertEquals(1, operator_modulo(left, Integer.valueOf(right))); - } - - @Test - public void operator_modulo_Long_Number() throws Exception { - assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_modulo_Long_short() throws Exception { - assertEquals(1, operator_modulo(left, (short) right)); - } - - @Test - public void operator_modulo_Long_Short() throws Exception { - assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); - } - - @Test - public void operator_modulo_Long_AtomicInteger() throws Exception { - assertEquals(1, operator_modulo(left, new AtomicInteger(right))); - } - - @Test - public void operator_modulo_Long_AtomicLong() throws Exception { - assertEquals(1l, operator_modulo(left, new AtomicLong(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long) : long {", - " -left", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left) {", - " return (-(left.longValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Long_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Long left, final AtomicDouble right) {", - " return (left.longValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Long_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final long right) {", - " return (left.longValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Long_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Long right) {", - " return (left.longValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Long_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : byte) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final byte right) {", - " return (left.longValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Long_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Byte) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Byte right) {", - " return (left.longValue() - right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Long_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Long left, final float right) {", - " return (left.longValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Long_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Long left, final Float right) {", - " return (left.longValue() - right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Long_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : int) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final int right) {", - " return (left.longValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Long_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Integer) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Integer right) {", - " return (left.longValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Long_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : short) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final short right) {", - " return (left.longValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Long_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Short) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Short right) {", - " return (left.longValue() - right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Long_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Long, right : AtomicInteger) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final AtomicInteger right) {", - " return (left.longValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Long_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Long, right : AtomicLong) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final AtomicLong right) {", - " return (left.longValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Long_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Long right) {", - " return (left.longValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Long_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final long right) {", - " return (left.longValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Long_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : byte) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final byte right) {", - " return (left.longValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Long_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Byte) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Byte right) {", - " return (left.longValue() + right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Long_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Long left, final Float right) {", - " return (left.longValue() + right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Long_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Long left, final float right) {", - " return (left.longValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Long_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Integer) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Integer right) {", - " return (left.longValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Long_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : int) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final int right) {", - " return (left.longValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Long_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : short) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final short right) {", - " return (left.longValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Long_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Short) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Short right) {", - " return (left.longValue() + right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Long_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Long, right : AtomicInteger) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final AtomicInteger right) {", - " return (left.longValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Long_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Long right) {", - " return (left.longValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Long_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Long left, final AtomicDouble right) {", - " return (left.longValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Long_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Long left, final AtomicDouble right) {", - " return Math.pow(left.longValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Long_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : byte) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Long left, final byte right) {", - " return Math.pow(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Long_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : short) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Long left, final short right) {", - " return Math.pow(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Long_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : int) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Long left, final int right) {", - " return Math.pow(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Long_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : long) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Long left, final long right) {", - " return Math.pow(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Long_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : float) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Long left, final float right) {", - " return Math.pow(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Long_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : double) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Long left, final double right) {", - " return Math.pow(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Long_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final long right) {", - " return (left.longValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Long_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Long right) {", - " return (left.longValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Long_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : byte) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final byte right) {", - " return (left.longValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Long_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Byte) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Byte right) {", - " return (left.longValue() / right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Long_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Long left, final float right) {", - " return (left.longValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Long_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Long left, final Float right) {", - " return (left.longValue() / right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Long_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : int) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final int right) {", - " return (left.longValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Long_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Integer) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Integer right) {", - " return (left.longValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Long_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Long left, final AtomicDouble right) {", - " return (left.longValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Long_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : short) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final short right) {", - " return (left.longValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Long_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Short) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Short right) {", - " return (left.longValue() / right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Long_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Long, right : AtomicInteger) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final AtomicInteger right) {", - " return (left.longValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Long_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Long, right : AtomicLong) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final AtomicLong right) {", - " return (left.longValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Long_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final long right) {", - " return (left.longValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Long_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Long right) {", - " return (left.longValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Long_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : byte) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final byte right) {", - " return (left.longValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Long_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Byte) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Byte right) {", - " return (left.longValue() * right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Long_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Long left, final float right) {", - " return (left.longValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Long_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Long left, final Float right) {", - " return (left.longValue() * right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Long_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : int) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final int right) {", - " return (left.longValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Long_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Integer) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Integer right) {", - " return (left.longValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Long_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Long left, final AtomicDouble right) {", - " return (left.longValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Long_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : short) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final short right) {", - " return (left.longValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Long_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Short) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Short right) {", - " return (left.longValue() * right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Long_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Long, right : AtomicInteger) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final AtomicInteger right) {", - " return (left.longValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Long_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Long, right : AtomicLong) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final AtomicLong right) {", - " return (left.longValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Long_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final long right) {", - " return (left.longValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Long_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Long right) {", - " return (left.longValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Long_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Byte) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Byte right) {", - " return (left.longValue() % right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Long_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : byte) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final byte right) {", - " return (left.longValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Long_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Long left, final float right) {", - " return (left.longValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Long_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Long left, final Float right) {", - " return (left.longValue() % right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Long_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : int) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final int right) {", - " return (left.longValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Long_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Integer) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Integer right) {", - " return (left.longValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Long_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Long left, final AtomicDouble right) {", - " return (left.longValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Long_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : short) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final short right) {", - " return (left.longValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Long_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Short) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final Short right) {", - " return (left.longValue() % right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Long_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Long, right : AtomicInteger) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final AtomicInteger right) {", - " return (left.longValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Long_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Long, right : AtomicLong) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left, final AtomicLong right) {", - " return (left.longValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/NumberArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/NumberArithmeticExtensionsTest.java deleted file mode 100644 index 662994c086..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/NumberArithmeticExtensionsTest.java +++ /dev/null @@ -1,2741 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.NumberArithmeticExtensions.*; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - NumberArithmeticExtensionsTest.Code.class, - NumberArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class NumberArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Number left = new AtomicDouble(4); - - private static int right = 3; - - @Test - public void operator_minus_Number() throws Exception { - assertEpsilonEquals(-4, operator_minus(left)); - } - - @Test - public void operator_minus_Number_Number() throws Exception { - assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_minus_Number_long() throws Exception { - assertEpsilonEquals(1, operator_minus(left, (long) right)); - } - - @Test - public void operator_minus_Number_Long() throws Exception { - assertEpsilonEquals(1, operator_minus(left, Long.valueOf(right))); - } - - @Test - public void operator_minus_Number_byte() throws Exception { - assertEpsilonEquals(1, operator_minus(left, (byte)right)); - } - - @Test - public void operator_minus_Number_Byte() throws Exception { - assertEpsilonEquals(1, operator_minus(left, Byte.valueOf((byte)right))); - } - - @Test - public void operator_minus_Number_float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, (float) right)); - } - - @Test - public void operator_minus_Number_Float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); - } - - @Test - public void operator_minus_Number_int() throws Exception { - assertEpsilonEquals(1, operator_minus(left, (int) right)); - } - - @Test - public void operator_minus_Number_Integer() throws Exception { - assertEpsilonEquals(1, operator_minus(left, Integer.valueOf(right))); - } - - @Test - public void operator_minus_Number_short() throws Exception { - assertEpsilonEquals(1, operator_minus(left, (short) right)); - } - - @Test - public void operator_minus_Number_Short() throws Exception { - assertEpsilonEquals(1, operator_minus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_minus_Number_AtomicInteger() throws Exception { - assertEpsilonEquals(1, operator_minus(left, new AtomicInteger(right))); - } - - @Test - public void operator_minus_Number_AtomicLong() throws Exception { - assertEpsilonEquals(1l, operator_minus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_Number_long() throws Exception { - assertEpsilonEquals(7l, operator_plus(left, (long) right)); - } - - @Test - public void operator_plus_Number_Long() throws Exception { - assertEpsilonEquals(7l, operator_plus(left, Long.valueOf(right))); - } - - @Test - public void operator_plus_Number_byte() throws Exception { - assertEpsilonEquals(7, operator_plus(left, (byte) right)); - } - - @Test - public void operator_plus_Number_Byte() throws Exception { - assertEpsilonEquals(7, operator_plus(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_plus_Number_float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, (float) right)); - } - - @Test - public void operator_plus_Number_Float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); - } - - @Test - public void operator_plus_Number_int() throws Exception { - assertEpsilonEquals(7, operator_plus(left, (int) right)); - } - - @Test - public void operator_plus_Number_Integer() throws Exception { - assertEpsilonEquals(7, operator_plus(left, Integer.valueOf(right))); - } - - @Test - public void operator_plus_Number_short() throws Exception { - assertEpsilonEquals(7, operator_plus(left, (short) right)); - } - - @Test - public void operator_plus_Number_Short() throws Exception { - assertEpsilonEquals(7, operator_plus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_plus_Number_AtomicInteger() throws Exception { - assertEpsilonEquals(7, operator_plus(left, new AtomicInteger(right))); - } - - @Test - public void operator_plus_Number_AtomicLong() throws Exception { - assertEpsilonEquals(7l, operator_plus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_Number_Number() throws Exception { - assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_Number_Number() throws Exception { - assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_power_Number_byte() throws Exception { - assertEpsilonEquals(64., operator_power(left, (byte) right)); - } - - @Test - public void operator_power_Number_short() throws Exception { - assertEpsilonEquals(64., operator_power(left, (short) right)); - } - - @Test - public void operator_power_Number_int() throws Exception { - assertEpsilonEquals(64., operator_power(left, (int) right)); - } - - @Test - public void operator_power_Number_long() throws Exception { - assertEpsilonEquals(64., operator_power(left, (long) right)); - } - - @Test - public void operator_power_Number_float() throws Exception { - assertEpsilonEquals(64., operator_power(left, (float) right)); - } - - @Test - public void operator_power_Number_double() throws Exception { - assertEpsilonEquals(64., operator_power(left, (double) right)); - } - - @Test - public void operator_divide_Number_long() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (long) right)); - } - - @Test - public void operator_divide_Number_Long() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Long.valueOf(right))); - } - - @Test - public void operator_divide_Number_byte() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (byte) right)); - } - - @Test - public void operator_divide_Number_Byte() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_divide_Number_float() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (float) right)); - } - - @Test - public void operator_divide_Number_Float() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Float.valueOf(right))); - } - - @Test - public void operator_divide_Number_int() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (int) right)); - } - - @Test - public void operator_divide_Number_Integer() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Integer.valueOf(right))); - } - - @Test - public void operator_divide_Number_Number() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_divide_Number_short() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (short) right)); - } - - @Test - public void operator_divide_Number_Short() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Short.valueOf((short) right))); - } - - @Test - public void operator_divide_Number_AtomicInteger() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, new AtomicInteger(right))); - } - - @Test - public void operator_divide_Number_AtomicLong() throws Exception { - assertEpsilonEquals(1.333333333333333333333, operator_divide(left, new AtomicLong(right))); - } - - @Test - public void operator_multiply_Number_long() throws Exception { - assertEpsilonEquals(12l, operator_multiply(left, (long) right)); - } - - @Test - public void operator_multiply_Number_Long() throws Exception { - assertEpsilonEquals(12l, operator_multiply(left, Long.valueOf(right))); - } - - @Test - public void operator_multiply_Number_byte() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, (byte) right)); - } - - @Test - public void operator_multiply_Number_Byte() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_multiply_Number_float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, (float) right)); - } - - @Test - public void operator_multiply_Number_Float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); - } - - @Test - public void operator_multiply_Number_int() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, (int) right)); - } - - @Test - public void operator_multiply_Number_Integer() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, Integer.valueOf(right))); - } - - @Test - public void operator_multiply_Number_Number() throws Exception { - assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_multiply_Number_short() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, (short) right)); - } - - @Test - public void operator_multiply_Number_Short() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, Short.valueOf((short) right))); - } - - @Test - public void operator_multiply_Number_AtomicInteger() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, new AtomicInteger(right))); - } - - @Test - public void operator_multiply_Number_AtomicLong() throws Exception { - assertEpsilonEquals(12l, operator_multiply(left, new AtomicLong(right))); - } - - @Test - public void operator_modulo_Number_long() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, (long) right)); - } - - @Test - public void operator_modulo_Number_Long() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, Long.valueOf(right))); - } - - @Test - public void operator_modulo_Number_byte() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, (byte) right)); - } - - @Test - public void operator_modulo_Number_Byte() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_modulo_Number_float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, (float) right)); - } - - @Test - public void operator_modulo_Number_Float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); - } - - @Test - public void operator_modulo_Number_int() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, (int) right)); - } - - @Test - public void operator_modulo_Number_Integer() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, Integer.valueOf(right))); - } - - @Test - public void operator_modulo_Number_Number() throws Exception { - assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_modulo_Number_short() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, (short) right)); - } - - @Test - public void operator_modulo_Number_Short() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, Short.valueOf((short) right))); - } - - @Test - public void operator_modulo_Number_AtomicInteger() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, new AtomicInteger(right))); - } - - @Test - public void operator_modulo_Number_AtomicLong() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, new AtomicLong(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number) : double {", - " -left", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left) {", - " return (-(left.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Number_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicDouble right) {", - " return (left.doubleValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Number_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : long) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final long right) {", - " return (left.doubleValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Number_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Long) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Long right) {", - " return (left.doubleValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Number_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : byte) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final byte right) {", - " return (left.doubleValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Number_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Byte) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Byte right) {", - " return (left.doubleValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Number_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : float) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final float right) {", - " return (left.doubleValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Number_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Float) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Float right) {", - " return (left.doubleValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Number_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : int) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final int right) {", - " return (left.doubleValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Number_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Integer) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Integer right) {", - " return (left.doubleValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Number_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : short) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final short right) {", - " return (left.doubleValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Number_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Short) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Short right) {", - " return (left.doubleValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Number_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Number, right : AtomicInteger) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicInteger right) {", - " return (left.doubleValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Number_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Number, right : AtomicLong) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicLong right) {", - " return (left.doubleValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Number_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Long) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Long right) {", - " return (left.doubleValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Number_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : long) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final long right) {", - " return (left.doubleValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Number_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : byte) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final byte right) {", - " return (left.doubleValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Number_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Byte) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Byte right) {", - " return (left.doubleValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Number_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Float) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Float right) {", - " return (left.doubleValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Number_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : float) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final float right) {", - " return (left.doubleValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Number_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Integer) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Integer right) {", - " return (left.doubleValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Number_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : int) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final int right) {", - " return (left.doubleValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Number_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : short) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final short right) {", - " return (left.doubleValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Number_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Short) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Short right) {", - " return (left.doubleValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Number_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Number, right : AtomicInteger) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicInteger right) {", - " return (left.doubleValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Number_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Long) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Long right) {", - " return (left.doubleValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Number_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicDouble right) {", - " return (left.doubleValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Number_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicDouble right) {", - " return Math.pow(left.doubleValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Number_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : byte) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final byte right) {", - " return Math.pow(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Number_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : short) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final short right) {", - " return Math.pow(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Number_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : int) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final int right) {", - " return Math.pow(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Number_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : long) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final long right) {", - " return Math.pow(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Number_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : float) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final float right) {", - " return Math.pow(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Number_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : double) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final double right) {", - " return Math.pow(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Number_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : long) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final long right) {", - " return (left.doubleValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Number_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Long) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Long right) {", - " return (left.doubleValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Number_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : byte) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final byte right) {", - " return (left.doubleValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Number_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Byte) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Byte right) {", - " return (left.doubleValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Number_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : float) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final float right) {", - " return (left.doubleValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Number_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Float) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Float right) {", - " return (left.doubleValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Number_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : int) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final int right) {", - " return (left.doubleValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Number_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Integer) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Integer right) {", - " return (left.doubleValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Number_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicDouble right) {", - " return (left.doubleValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Number_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : short) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final short right) {", - " return (left.doubleValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Number_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Short) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Short right) {", - " return (left.doubleValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Number_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Number, right : AtomicInteger) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicInteger right) {", - " return (left.doubleValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Number_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Number, right : AtomicLong) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicLong right) {", - " return (left.doubleValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Number_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : long) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final long right) {", - " return (left.doubleValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Number_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Long) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Long right) {", - " return (left.doubleValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Number_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : byte) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final byte right) {", - " return (left.doubleValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Number_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Byte) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Byte right) {", - " return (left.doubleValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Number_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : float) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final float right) {", - " return (left.doubleValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Number_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Float) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Float right) {", - " return (left.doubleValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Number_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : int) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final int right) {", - " return (left.doubleValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Number_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Integer) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Integer right) {", - " return (left.doubleValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Number_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicDouble right) {", - " return (left.doubleValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Number_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : short) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final short right) {", - " return (left.doubleValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Number_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Short) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Short right) {", - " return (left.doubleValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Number_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Number, right : AtomicInteger) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicInteger right) {", - " return (left.doubleValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Number_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Number, right : AtomicLong) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicLong right) {", - " return (left.doubleValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Number_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : long) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final long right) {", - " return (left.doubleValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Number_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Long) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Long right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Number_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Byte) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Byte right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Number_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : byte) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final byte right) {", - " return (left.doubleValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Number_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : float) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final float right) {", - " return (left.doubleValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Number_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Float) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Float right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Number_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : int) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final int right) {", - " return (left.doubleValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Number_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Integer) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Integer right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Number_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicDouble right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Number_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : short) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final short right) {", - " return (left.doubleValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Number_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Short) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final Short right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Number_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Number, right : AtomicInteger) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicInteger right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Number_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Number, right : AtomicLong) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Number left, final AtomicLong right) {", - " return (left.doubleValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveByteArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveByteArithmeticExtensionsTest.java deleted file mode 100644 index 9697e22922..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveByteArithmeticExtensionsTest.java +++ /dev/null @@ -1,1592 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveByteArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveByteArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveByteArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveByteArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveByteArithmeticExtensions.operator_plus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveByteArithmeticExtensions.operator_power; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveByteArithmeticExtensionsTest.Code.class, - PrimitiveByteArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveByteArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static byte left = 4; - - private static int right = 3; - - @Test - public void operator_minus_byte_Number() throws Exception { - assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_minus_byte_Long() throws Exception { - assertEquals(1, operator_minus(left, Long.valueOf(right))); - } - - @Test - public void operator_minus_byte_Byte() throws Exception { - assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); - } - - @Test - public void operator_minus_byte_Float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); - } - - @Test - public void operator_minus_byte_Integer() throws Exception { - assertEquals(1, operator_minus(left, Integer.valueOf(right))); - } - - @Test - public void operator_minus_byte_Short() throws Exception { - assertEquals(1, operator_minus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_minus_byte_AtomicInteger() throws Exception { - assertEquals(1, operator_minus(left, new AtomicInteger(right))); - } - - @Test - public void operator_minus_byte_AtomicLong() throws Exception { - assertEquals(1l, operator_minus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_byte_Long() throws Exception { - assertEquals(7l, operator_plus(left, Long.valueOf(right))); - } - - @Test - public void operator_plus_byte_Byte() throws Exception { - assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_plus_byte_Float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); - } - - @Test - public void operator_plus_byte_Integer() throws Exception { - assertEquals(7, operator_plus(left, Integer.valueOf(right))); - } - - @Test - public void operator_plus_byte_Short() throws Exception { - assertEquals(7, operator_plus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_plus_byte_AtomicInteger() throws Exception { - assertEquals(7, operator_plus(left, new AtomicInteger(right))); - } - - @Test - public void operator_plus_byte_AtomicLong() throws Exception { - assertEquals(7l, operator_plus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_byte_Number() throws Exception { - assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_byte_Number() throws Exception { - assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_divide_byte_Long() throws Exception { - assertEquals(1l, operator_divide(left, Long.valueOf(right))); - } - - @Test - public void operator_divide_byte_Byte() throws Exception { - assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_divide_byte_Float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); - } - - @Test - public void operator_divide_byte_Integer() throws Exception { - assertEquals(1, operator_divide(left, Integer.valueOf(right))); - } - - @Test - public void operator_divide_byte_Number() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_divide_byte_Short() throws Exception { - assertEquals(1, operator_divide(left, Short.valueOf((short) right))); - } - - @Test - public void operator_divide_byte_AtomicInteger() throws Exception { - assertEquals(1, operator_divide(left, new AtomicInteger(right))); - } - - @Test - public void operator_divide_byte_AtomicLong() throws Exception { - assertEquals(1l, operator_divide(left, new AtomicLong(right))); - } - - @Test - public void operator_multiply_byte_Long() throws Exception { - assertEquals(12l, operator_multiply(left, Long.valueOf(right))); - } - - @Test - public void operator_multiply_byte_Byte() throws Exception { - assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_multiply_byte_Float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); - } - - @Test - public void operator_multiply_byte_Integer() throws Exception { - assertEquals(12, operator_multiply(left, Integer.valueOf(right))); - } - - @Test - public void operator_multiply_byte_Number() throws Exception { - assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_multiply_byte_Short() throws Exception { - assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); - } - - @Test - public void operator_multiply_byte_AtomicInteger() throws Exception { - assertEquals(12, operator_multiply(left, new AtomicInteger(right))); - } - - @Test - public void operator_multiply_byte_AtomicLong() throws Exception { - assertEquals(12l, operator_multiply(left, new AtomicLong(right))); - } - - @Test - public void operator_modulo_byte_Long() throws Exception { - assertEquals(1l, operator_modulo(left, Long.valueOf(right))); - } - - @Test - public void operator_modulo_byte_Byte() throws Exception { - assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_modulo_byte_Float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); - } - - @Test - public void operator_modulo_byte_Integer() throws Exception { - assertEquals(1, operator_modulo(left, Integer.valueOf(right))); - } - - @Test - public void operator_modulo_byte_Number() throws Exception { - assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_modulo_byte_Short() throws Exception { - assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); - } - - @Test - public void operator_modulo_byte_AtomicInteger() throws Exception { - assertEquals(1, operator_modulo(left, new AtomicInteger(right))); - } - - @Test - public void operator_modulo_byte_AtomicLong() throws Exception { - assertEquals(1l, operator_modulo(left, new AtomicLong(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final byte left, final AtomicDouble right) {", - " return (left - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final byte left, final Long right) {", - " return (left - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Byte) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Byte right) {", - " return (left - right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final byte left, final Float right) {", - " return (left - right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Integer) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Integer right) {", - " return (left - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Short) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Short right) {", - " return (left - right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : byte, right : AtomicInteger) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final AtomicInteger right) {", - " return (left - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : byte, right : AtomicLong) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final byte left, final AtomicLong right) {", - " return (left - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final byte left, final Long right) {", - " return (left + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Byte) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Byte right) {", - " return (left + right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final byte left, final Float right) {", - " return (left + right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Integer) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Integer right) {", - " return (left + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Short) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Short right) {", - " return (left + right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : byte, right : AtomicInteger) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final AtomicInteger right) {", - " return (left + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final byte left, final Long right) {", - " return (left + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final byte left, final AtomicDouble right) {", - " return (left + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final byte left, final AtomicDouble right) {", - " return Math.pow(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final byte left, final Long right) {", - " return (left / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Byte) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Byte right) {", - " return (left / right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final byte left, final Float right) {", - " return (left / right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Integer) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Integer right) {", - " return (left / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final byte left, final AtomicDouble right) {", - " return (left / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Short) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Short right) {", - " return (left / right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : byte, right : AtomicInteger) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final AtomicInteger right) {", - " return (left / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : byte, right : AtomicLong) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final byte left, final AtomicLong right) {", - " return (left / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final byte left, final Long right) {", - " return (left * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Byte) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Byte right) {", - " return (left * right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final byte left, final Float right) {", - " return (left * right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Integer) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Integer right) {", - " return (left * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final byte left, final AtomicDouble right) {", - " return (left * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Short) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Short right) {", - " return (left * right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : byte, right : AtomicInteger) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final AtomicInteger right) {", - " return (left * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : byte, right : AtomicLong) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final byte left, final AtomicLong right) {", - " return (left * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final byte left, final Long right) {", - " return (left % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Byte) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Byte right) {", - " return (left % right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final byte left, final Float right) {", - " return (left % right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Integer) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Integer right) {", - " return (left % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final byte left, final AtomicDouble right) {", - " return (left % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Short) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Short right) {", - " return (left % right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : byte, right : AtomicInteger) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final AtomicInteger right) {", - " return (left % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : byte, right : AtomicLong) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final byte left, final AtomicLong right) {", - " return (left % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveDoubleArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveDoubleArithmeticExtensionsTest.java deleted file mode 100644 index 6365bcfd03..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveDoubleArithmeticExtensionsTest.java +++ /dev/null @@ -1,1414 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions.operator_plus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions.operator_power; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveDoubleArithmeticExtensionsTest.Code.class, - PrimitiveDoubleArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveDoubleArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static double left = 4.; - - private static int right = 3; - - @Test - public void operator_minus_double_Number() { - assertEpsilonEquals(1., operator_minus(left, Double.valueOf(right))); - } - - @Test - public void operator_plus_double_Number() { - assertEpsilonEquals(7., operator_plus(left, Double.valueOf(right))); - } - - @Test - public void operator_power_double_Number() { - assertEpsilonEquals(64., operator_power(left, Double.valueOf(right))); - } - - @Test - public void operator_divide_double_Number() { - assertEpsilonEquals(1.33333333333333333333, operator_divide(left, Double.valueOf(right))); - } - - @Test - public void operator_multiply_double_Number() { - assertEpsilonEquals(12., operator_multiply(left, Double.valueOf(right))); - } - - @Test - public void operator_modulo_double_Number() { - assertEpsilonEquals(1., operator_modulo(left, Double.valueOf(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicDouble right) {", - " return (left - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Long) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Long right) {", - " return (left - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Byte) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Byte right) {", - " return (left - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Float) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Float right) {", - " return (left - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Integer) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Integer right) {", - " return (left - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Short) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Short right) {", - " return (left - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : double, right : AtomicInteger) : double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicInteger right) {", - " return (left - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : double, right : AtomicLong): double {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicLong right) {", - " return (left - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Long): double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Long right) {", - " return (left + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Byte): double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Byte right) {", - " return (left + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Float) : double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Float right) {", - " return (left + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Integer): double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Integer right) {", - " return (left + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Short): double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Short right) {", - " return (left + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : double, right : AtomicInteger): double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicInteger right) {", - " return (left + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Long): double {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Long right) {", - " return (left + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicDouble right) {", - " return (left + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicDouble right) {", - " return Math.pow(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Long): double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Long right) {", - " return (left / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Byte): double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Byte right) {", - " return (left / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Float) : double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Float right) {", - " return (left / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Integer): double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Integer right) {", - " return (left / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicDouble right) {", - " return (left / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Short): double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Short right) {", - " return (left / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : double, right : AtomicInteger): double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicInteger right) {", - " return (left / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : double, right : AtomicLong): double {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicLong right) {", - " return (left / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Long): double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Long right) {", - " return (left * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Byte): double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Byte right) {", - " return (left * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Float) : double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Float right) {", - " return (left * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Integer): double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Integer right) {", - " return (left * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicDouble right) {", - " return (left * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Short): double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Short right) {", - " return (left * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : double, right : AtomicInteger): double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicInteger right) {", - " return (left * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : double, right : AtomicLong): double {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicLong right) {", - " return (left * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Long): double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Long right) {", - " return (left % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Byte): double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Byte right) {", - " return (left % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Float) : double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Float right) {", - " return (left % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Integer): double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Integer right) {", - " return (left % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicDouble right) {", - " return (left % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Short): double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final Short right) {", - " return (left % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : double, right : AtomicInteger): double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicInteger right) {", - " return (left % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : double, right : AtomicLong): double {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left, final AtomicLong right) {", - " return (left % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveFloatArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveFloatArithmeticExtensionsTest.java deleted file mode 100644 index 0dd1306058..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveFloatArithmeticExtensionsTest.java +++ /dev/null @@ -1,1592 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveFloatArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveFloatArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveFloatArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveFloatArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveFloatArithmeticExtensions.operator_plus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveFloatArithmeticExtensions.operator_power; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveFloatArithmeticExtensionsTest.Code.class, - PrimitiveFloatArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveFloatArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static float left = 4f; - - private static int right = 3; - - @Test - public void operator_minus_float_Number() throws Exception { - assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_minus_float_Long() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Long.valueOf(right))); - } - - @Test - public void operator_minus_float_Byte() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Byte.valueOf((byte)right))); - } - - @Test - public void operator_minus_float_Float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); - } - - @Test - public void operator_minus_float_Integer() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Integer.valueOf(right))); - } - - @Test - public void operator_minus_float_Short() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_minus_float_AtomicInteger() throws Exception { - assertEpsilonEquals(1, operator_minus(left, new AtomicInteger(right))); - } - - @Test - public void operator_minus_float_AtomicLong() throws Exception { - assertEpsilonEquals(1l, operator_minus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_float_Long() throws Exception { - assertEpsilonEquals(7l, operator_plus(left, Long.valueOf(right))); - } - - @Test - public void operator_plus_float_Byte() throws Exception { - assertEpsilonEquals(7, operator_plus(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_plus_float_Float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); - } - - @Test - public void operator_plus_float_Integer() throws Exception { - assertEpsilonEquals(7, operator_plus(left, Integer.valueOf(right))); - } - - @Test - public void operator_plus_float_Short() throws Exception { - assertEpsilonEquals(7, operator_plus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_plus_float_AtomicInteger() throws Exception { - assertEpsilonEquals(7, operator_plus(left, new AtomicInteger(right))); - } - - @Test - public void operator_plus_float_AtomicLong() throws Exception { - assertEpsilonEquals(7l, operator_plus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_float_Number() throws Exception { - assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_float_Number() throws Exception { - assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_divide_float_Long() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, Long.valueOf(right))); - } - - @Test - public void operator_divide_float_Byte() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_divide_float_Float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); - } - - @Test - public void operator_divide_float_Integer() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, Integer.valueOf(right))); - } - - @Test - public void operator_divide_float_Number() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_divide_float_Short() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, Short.valueOf((short) right))); - } - - @Test - public void operator_divide_float_AtomicInteger() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, new AtomicInteger(right))); - } - - @Test - public void operator_divide_float_AtomicLong() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, new AtomicLong(right))); - } - - @Test - public void operator_multiply_float_Long() throws Exception { - assertEpsilonEquals(12l, operator_multiply(left, Long.valueOf(right))); - } - - @Test - public void operator_multiply_float_Byte() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_multiply_float_Float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); - } - - @Test - public void operator_multiply_float_Integer() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, Integer.valueOf(right))); - } - - @Test - public void operator_multiply_float_Number() throws Exception { - assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_multiply_float_Short() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, Short.valueOf((short) right))); - } - - @Test - public void operator_multiply_float_AtomicInteger() throws Exception { - assertEpsilonEquals(12, operator_multiply(left, new AtomicInteger(right))); - } - - @Test - public void operator_multiply_float_AtomicLong() throws Exception { - assertEpsilonEquals(12l, operator_multiply(left, new AtomicLong(right))); - } - - @Test - public void operator_modulo_float_Long() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, Long.valueOf(right))); - } - - @Test - public void operator_modulo_float_Byte() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_modulo_float_Float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); - } - - @Test - public void operator_modulo_float_Integer() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, Integer.valueOf(right))); - } - - @Test - public void operator_modulo_float_Number() throws Exception { - assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_modulo_float_Short() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, Short.valueOf((short) right))); - } - - @Test - public void operator_modulo_float_AtomicInteger() throws Exception { - assertEpsilonEquals(1, operator_modulo(left, new AtomicInteger(right))); - } - - @Test - public void operator_modulo_float_AtomicLong() throws Exception { - assertEpsilonEquals(1l, operator_modulo(left, new AtomicLong(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_float_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final float left, final AtomicDouble right) {", - " return (left - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_float_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Long) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Long right) {", - " return (left - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_float_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Byte) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Byte right) {", - " return (left - right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_float_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Float right) {", - " return (left - right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_float_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Integer) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Integer right) {", - " return (left - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_float_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Short) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Short right) {", - " return (left - right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_float_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : float, right : AtomicInteger) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final AtomicInteger right) {", - " return (left - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_float_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : float, right : AtomicLong): float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final AtomicLong right) {", - " return (left - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_float_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Long): float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Long right) {", - " return (left + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_float_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Byte): float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Byte right) {", - " return (left + right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_float_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Float right) {", - " return (left + right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_float_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Integer): float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Integer right) {", - " return (left + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_float_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Short): float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Short right) {", - " return (left + right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_float_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : float, right : AtomicInteger): float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final AtomicInteger right) {", - " return (left + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_float_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Long): float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Long right) {", - " return (left + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_float_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final float left, final AtomicDouble right) {", - " return (left + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_float_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final float left, final AtomicDouble right) {", - " return Math.pow(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_float_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Long): float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Long right) {", - " return (left / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_float_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Byte): float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Byte right) {", - " return (left / right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_float_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Float right) {", - " return (left / right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_float_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Integer): float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Integer right) {", - " return (left / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_float_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final float left, final AtomicDouble right) {", - " return (left / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_float_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Short): float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Short right) {", - " return (left / right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_float_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : float, right : AtomicInteger): float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final AtomicInteger right) {", - " return (left / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_float_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : float, right : AtomicLong): float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final AtomicLong right) {", - " return (left / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_float_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Long): float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Long right) {", - " return (left * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_float_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Byte): float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Byte right) {", - " return (left * right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_float_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Float right) {", - " return (left * right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_float_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Integer): float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Integer right) {", - " return (left * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_float_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final float left, final AtomicDouble right) {", - " return (left * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_float_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Short): float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Short right) {", - " return (left * right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_float_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : float, right : AtomicInteger): float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final AtomicInteger right) {", - " return (left * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_float_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : float, right : AtomicLong): float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final AtomicLong right) {", - " return (left * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_float_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Long): float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Long right) {", - " return (left % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_float_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Byte): float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Byte right) {", - " return (left % right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_float_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Float right) {", - " return (left % right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_float_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Integer): float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Integer right) {", - " return (left % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_float_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final float left, final AtomicDouble right) {", - " return (left % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_float_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Short): float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final Short right) {", - " return (left % right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_float_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : float, right : AtomicInteger): float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final AtomicInteger right) {", - " return (left % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_float_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : float, right : AtomicLong): float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left, final AtomicLong right) {", - " return (left % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveIntArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveIntArithmeticExtensionsTest.java deleted file mode 100644 index 11d29500cd..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveIntArithmeticExtensionsTest.java +++ /dev/null @@ -1,1593 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveIntArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveIntArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveIntArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveIntArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveIntArithmeticExtensions.operator_plus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveIntArithmeticExtensions.operator_power; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveIntArithmeticExtensionsTest.Code.class, - PrimitiveIntArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveIntArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static int left = 4; - - private static int right = 3; - - @Test - public void operator_minus_int_Number() throws Exception { - assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_minus_int_Long() throws Exception { - assertEquals(1, operator_minus(left, Long.valueOf(right))); - } - - @Test - public void operator_minus_int_Byte() throws Exception { - assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); - } - - @Test - public void operator_minus_int_Float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); - } - - @Test - public void operator_minus_int_Integer() throws Exception { - assertEquals(1, operator_minus(left, Integer.valueOf(right))); - } - - @Test - public void operator_minus_int_Short() throws Exception { - assertEquals(1, operator_minus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_minus_int_AtomicInteger() throws Exception { - assertEquals(1, operator_minus(left, new AtomicInteger(right))); - } - - @Test - public void operator_minus_int_AtomicLong() throws Exception { - assertEquals(1l, operator_minus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_int_Long() throws Exception { - assertEquals(7l, operator_plus(left, Long.valueOf(right))); - } - - @Test - public void operator_plus_int_Byte() throws Exception { - assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_plus_int_Float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); - } - - @Test - public void operator_plus_int_Integer() throws Exception { - assertEquals(7, operator_plus(left, Integer.valueOf(right))); - } - - @Test - public void operator_plus_int_Short() throws Exception { - assertEquals(7, operator_plus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_plus_int_AtomicInteger() throws Exception { - assertEquals(7, operator_plus(left, new AtomicInteger(right))); - } - - @Test - public void operator_plus_int_AtomicLong() throws Exception { - assertEquals(7l, operator_plus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_int_Number() throws Exception { - assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_int_Number() throws Exception { - assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_divide_int_Long() throws Exception { - assertEquals(1l, operator_divide(left, Long.valueOf(right))); - } - - @Test - public void operator_divide_int_Byte() throws Exception { - assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_divide_int_Float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); - } - - @Test - public void operator_divide_int_Integer() throws Exception { - assertEquals(1, operator_divide(left, Integer.valueOf(right))); - } - - @Test - public void operator_divide_int_Number() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_divide_int_Short() throws Exception { - assertEquals(1, operator_divide(left, Short.valueOf((short) right))); - } - - @Test - public void operator_divide_int_AtomicInteger() throws Exception { - assertEquals(1, operator_divide(left, new AtomicInteger(right))); - } - - @Test - public void operator_divide_int_AtomicLong() throws Exception { - assertEquals(1l, operator_divide(left, new AtomicLong(right))); - } - - @Test - public void operator_multiply_int_Long() throws Exception { - assertEquals(12l, operator_multiply(left, Long.valueOf(right))); - } - - @Test - public void operator_multiply_int_Byte() throws Exception { - assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_multiply_int_Float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); - } - - @Test - public void operator_multiply_int_Integer() throws Exception { - assertEquals(12, operator_multiply(left, Integer.valueOf(right))); - } - - @Test - public void operator_multiply_int_Number() throws Exception { - assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_multiply_int_Short() throws Exception { - assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); - } - - @Test - public void operator_multiply_int_AtomicInteger() throws Exception { - assertEquals(12, operator_multiply(left, new AtomicInteger(right))); - } - - @Test - public void operator_multiply_int_AtomicLong() throws Exception { - assertEquals(12l, operator_multiply(left, new AtomicLong(right))); - } - - @Test - public void operator_modulo_int_Long() throws Exception { - assertEquals(1l, operator_modulo(left, Long.valueOf(right))); - } - - @Test - public void operator_modulo_int_Byte() throws Exception { - assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_modulo_int_Float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); - } - - @Test - public void operator_modulo_int_Integer() throws Exception { - assertEquals(1, operator_modulo(left, Integer.valueOf(right))); - } - - @Test - public void operator_modulo_int_Number() throws Exception { - assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_modulo_int_Short() throws Exception { - assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); - } - - @Test - public void operator_modulo_int_AtomicInteger() throws Exception { - assertEquals(1, operator_modulo(left, new AtomicInteger(right))); - } - - @Test - public void operator_modulo_int_AtomicLong() throws Exception { - assertEquals(1l, operator_modulo(left, new AtomicLong(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_int_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final int left, final AtomicDouble right) {", - " return (left - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_int_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final int left, final Long right) {", - " return (left - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_int_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Byte) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Byte right) {", - " return (left - right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_int_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final int left, final Float right) {", - " return (left - right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_int_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Integer) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Integer right) {", - " return (left - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_int_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Short) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Short right) {", - " return (left - right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_int_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : int, right : AtomicInteger) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final AtomicInteger right) {", - " return (left - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_int_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : int, right : AtomicLong) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final int left, final AtomicLong right) {", - " return (left - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_int_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final int left, final Long right) {", - " return (left + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_int_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Byte) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Byte right) {", - " return (left + right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_int_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final int left, final Float right) {", - " return (left + right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_int_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Integer) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Integer right) {", - " return (left + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_int_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Short) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Short right) {", - " return (left + right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_int_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : int, right : AtomicInteger) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final AtomicInteger right) {", - " return (left + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_int_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final int left, final Long right) {", - " return (left + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_int_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final int left, final AtomicDouble right) {", - " return (left + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_int_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final int left, final AtomicDouble right) {", - " return Math.pow(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_int_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final int left, final Long right) {", - " return (left / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_int_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Byte) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Byte right) {", - " return (left / right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_int_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final int left, final Float right) {", - " return (left / right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_int_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Integer) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Integer right) {", - " return (left / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_int_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final int left, final AtomicDouble right) {", - " return (left / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_int_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Short) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Short right) {", - " return (left / right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_int_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : int, right : AtomicInteger) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final AtomicInteger right) {", - " return (left / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_int_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : int, right : AtomicLong) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final int left, final AtomicLong right) {", - " return (left / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_int_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final int left, final Long right) {", - " return (left * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_int_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Byte) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Byte right) {", - " return (left * right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_int_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final int left, final Float right) {", - " return (left * right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_int_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Integer) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Integer right) {", - " return (left * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_int_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final int left, final AtomicDouble right) {", - " return (left * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_int_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Short) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Short right) {", - " return (left * right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_int_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : int, right : AtomicInteger) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final AtomicInteger right) {", - " return (left * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_int_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : int, right : AtomicLong) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final int left, final AtomicLong right) {", - " return (left * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_int_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final int left, final Long right) {", - " return (left % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_int_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Byte) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Byte right) {", - " return (left % right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_int_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final int left, final Float right) {", - " return (left % right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_int_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Integer) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Integer right) {", - " return (left % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_int_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final int left, final AtomicDouble right) {", - " return (left % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_int_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Short) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Short right) {", - " return (left % right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_int_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : int, right : AtomicInteger) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final AtomicInteger right) {", - " return (left % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_int_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : int, right : AtomicLong) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final int left, final AtomicLong right) {", - " return (left % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveLongArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveLongArithmeticExtensionsTest.java deleted file mode 100644 index 5e37d5027a..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveLongArithmeticExtensionsTest.java +++ /dev/null @@ -1,1592 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveLongArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveLongArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveLongArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveLongArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveLongArithmeticExtensions.operator_plus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveLongArithmeticExtensions.operator_power; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveLongArithmeticExtensionsTest.Code.class, - PrimitiveLongArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveLongArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static long left = 4; - - private static int right = 3; - - @Test - public void operator_minus_long_Number() throws Exception { - assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_minus_long_Long() throws Exception { - assertEquals(1, operator_minus(left, Long.valueOf(right))); - } - - @Test - public void operator_minus_long_Byte() throws Exception { - assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); - } - - @Test - public void operator_minus_long_Float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); - } - - @Test - public void operator_minus_long_Integer() throws Exception { - assertEquals(1, operator_minus(left, Integer.valueOf(right))); - } - - @Test - public void operator_minus_long_Short() throws Exception { - assertEquals(1, operator_minus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_minus_long_AtomicInteger() throws Exception { - assertEquals(1, operator_minus(left, new AtomicInteger(right))); - } - - @Test - public void operator_minus_long_AtomicLong() throws Exception { - assertEquals(1l, operator_minus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_long_Long() throws Exception { - assertEquals(7l, operator_plus(left, Long.valueOf(right))); - } - - @Test - public void operator_plus_long_Byte() throws Exception { - assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_plus_long_Float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); - } - - @Test - public void operator_plus_long_Integer() throws Exception { - assertEquals(7, operator_plus(left, Integer.valueOf(right))); - } - - @Test - public void operator_plus_long_Short() throws Exception { - assertEquals(7, operator_plus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_plus_long_AtomicInteger() throws Exception { - assertEquals(7, operator_plus(left, new AtomicInteger(right))); - } - - @Test - public void operator_plus_long_AtomicLong() throws Exception { - assertEquals(7l, operator_plus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_long_Number() throws Exception { - assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_long_Number() throws Exception { - assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_divide_long_Long() throws Exception { - assertEquals(1l, operator_divide(left, Long.valueOf(right))); - } - - @Test - public void operator_divide_long_Byte() throws Exception { - assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_divide_long_Float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); - } - - @Test - public void operator_divide_long_Integer() throws Exception { - assertEquals(1, operator_divide(left, Integer.valueOf(right))); - } - - @Test - public void operator_divide_long_Number() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_divide_long_Short() throws Exception { - assertEquals(1, operator_divide(left, Short.valueOf((short) right))); - } - - @Test - public void operator_divide_long_AtomicInteger() throws Exception { - assertEquals(1, operator_divide(left, new AtomicInteger(right))); - } - - @Test - public void operator_divide_long_AtomicLong() throws Exception { - assertEquals(1l, operator_divide(left, new AtomicLong(right))); - } - - @Test - public void operator_multiply_long_Long() throws Exception { - assertEquals(12l, operator_multiply(left, Long.valueOf(right))); - } - - @Test - public void operator_multiply_long_Byte() throws Exception { - assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_multiply_long_Float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); - } - - @Test - public void operator_multiply_long_Integer() throws Exception { - assertEquals(12, operator_multiply(left, Integer.valueOf(right))); - } - - @Test - public void operator_multiply_long_Number() throws Exception { - assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_multiply_long_Short() throws Exception { - assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); - } - - @Test - public void operator_multiply_long_AtomicInteger() throws Exception { - assertEquals(12, operator_multiply(left, new AtomicInteger(right))); - } - - @Test - public void operator_multiply_long_AtomicLong() throws Exception { - assertEquals(12l, operator_multiply(left, new AtomicLong(right))); - } - - @Test - public void operator_modulo_long_Long() throws Exception { - assertEquals(1l, operator_modulo(left, Long.valueOf(right))); - } - - @Test - public void operator_modulo_long_Byte() throws Exception { - assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_modulo_long_Float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); - } - - @Test - public void operator_modulo_long_Integer() throws Exception { - assertEquals(1, operator_modulo(left, Integer.valueOf(right))); - } - - @Test - public void operator_modulo_long_Number() throws Exception { - assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_modulo_long_Short() throws Exception { - assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); - } - - @Test - public void operator_modulo_long_AtomicInteger() throws Exception { - assertEquals(1, operator_modulo(left, new AtomicInteger(right))); - } - - @Test - public void operator_modulo_long_AtomicLong() throws Exception { - assertEquals(1l, operator_modulo(left, new AtomicLong(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_long_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : long, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final long left, final AtomicDouble right) {", - " return (left - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_long_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Long right) {", - " return (left - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_long_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Byte) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Byte right) {", - " return (left - right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_long_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final long left, final Float right) {", - " return (left - right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_long_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Integer) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Integer right) {", - " return (left - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_long_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Short) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Short right) {", - " return (left - right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_long_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : long, right : AtomicInteger) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final AtomicInteger right) {", - " return (left - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_long_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : long, right : AtomicLong) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final AtomicLong right) {", - " return (left - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_long_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Long right) {", - " return (left + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_long_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Byte) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Byte right) {", - " return (left + right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_long_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final long left, final Float right) {", - " return (left + right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_long_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Integer) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Integer right) {", - " return (left + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_long_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Short) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Short right) {", - " return (left + right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_long_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : long, right : AtomicInteger) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final AtomicInteger right) {", - " return (left + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_long_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Long right) {", - " return (left + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_long_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : long, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final long left, final AtomicDouble right) {", - " return (left + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_long_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : long, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final long left, final AtomicDouble right) {", - " return Math.pow(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_long_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Long right) {", - " return (left / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_long_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Byte) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Byte right) {", - " return (left / right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_long_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final long left, final Float right) {", - " return (left / right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_long_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Integer) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Integer right) {", - " return (left / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_long_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : long, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final long left, final AtomicDouble right) {", - " return (left / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_long_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Short) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Short right) {", - " return (left / right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_long_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : long, right : AtomicInteger) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final AtomicInteger right) {", - " return (left / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_long_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : long, right : AtomicLong) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final AtomicLong right) {", - " return (left / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_long_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Long right) {", - " return (left * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_long_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Byte) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Byte right) {", - " return (left * right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_long_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final long left, final Float right) {", - " return (left * right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_long_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Integer) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Integer right) {", - " return (left * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_long_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : long, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final long left, final AtomicDouble right) {", - " return (left * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_long_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Short) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Short right) {", - " return (left * right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_long_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : long, right : AtomicInteger) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final AtomicInteger right) {", - " return (left * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_long_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : long, right : AtomicLong) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final AtomicLong right) {", - " return (left * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_long_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Long right) {", - " return (left % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_long_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Byte) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Byte right) {", - " return (left % right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_long_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final long left, final Float right) {", - " return (left % right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_long_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Integer) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Integer right) {", - " return (left % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_long_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : long, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final long left, final AtomicDouble right) {", - " return (left % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_long_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long, right : Short) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final Short right) {", - " return (left % right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_long_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : long, right : AtomicInteger) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final AtomicInteger right) {", - " return (left % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_long_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : long, right : AtomicLong) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left, final AtomicLong right) {", - " return (left % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveShortArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveShortArithmeticExtensionsTest.java deleted file mode 100644 index cb6c9a4c51..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/PrimitiveShortArithmeticExtensionsTest.java +++ /dev/null @@ -1,1592 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveShortArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveShortArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveShortArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveShortArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveShortArithmeticExtensions.operator_plus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveShortArithmeticExtensions.operator_power; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveShortArithmeticExtensionsTest.Code.class, - PrimitiveShortArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveShortArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static short left = 4; - - private static int right = 3; - - @Test - public void operator_minus_short_Number() throws Exception { - assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_minus_short_Long() throws Exception { - assertEquals(1, operator_minus(left, Long.valueOf(right))); - } - - @Test - public void operator_minus_short_Byte() throws Exception { - assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); - } - - @Test - public void operator_minus_short_Float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); - } - - @Test - public void operator_minus_short_Integer() throws Exception { - assertEquals(1, operator_minus(left, Integer.valueOf(right))); - } - - @Test - public void operator_minus_short_Short() throws Exception { - assertEquals(1, operator_minus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_minus_short_AtomicInteger() throws Exception { - assertEquals(1, operator_minus(left, new AtomicInteger(right))); - } - - @Test - public void operator_minus_short_AtomicLong() throws Exception { - assertEquals(1l, operator_minus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_short_Long() throws Exception { - assertEquals(7l, operator_plus(left, Long.valueOf(right))); - } - - @Test - public void operator_plus_short_Byte() throws Exception { - assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_plus_short_Float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); - } - - @Test - public void operator_plus_short_Integer() throws Exception { - assertEquals(7, operator_plus(left, Integer.valueOf(right))); - } - - @Test - public void operator_plus_short_Short() throws Exception { - assertEquals(7, operator_plus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_plus_short_AtomicInteger() throws Exception { - assertEquals(7, operator_plus(left, new AtomicInteger(right))); - } - - @Test - public void operator_plus_short_AtomicLong() throws Exception { - assertEquals(7l, operator_plus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_short_Number() throws Exception { - assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_short_Number() throws Exception { - assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_divide_short_Long() throws Exception { - assertEquals(1l, operator_divide(left, Long.valueOf(right))); - } - - @Test - public void operator_divide_short_Byte() throws Exception { - assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_divide_short_Float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); - } - - @Test - public void operator_divide_short_Integer() throws Exception { - assertEquals(1, operator_divide(left, Integer.valueOf(right))); - } - - @Test - public void operator_divide_short_Number() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_divide_short_Short() throws Exception { - assertEquals(1, operator_divide(left, Short.valueOf((short) right))); - } - - @Test - public void operator_divide_short_AtomicInteger() throws Exception { - assertEquals(1, operator_divide(left, new AtomicInteger(right))); - } - - @Test - public void operator_divide_short_AtomicLong() throws Exception { - assertEquals(1l, operator_divide(left, new AtomicLong(right))); - } - - @Test - public void operator_multiply_short_Long() throws Exception { - assertEquals(12l, operator_multiply(left, Long.valueOf(right))); - } - - @Test - public void operator_multiply_short_Byte() throws Exception { - assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_multiply_short_Float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); - } - - @Test - public void operator_multiply_short_Integer() throws Exception { - assertEquals(12, operator_multiply(left, Integer.valueOf(right))); - } - - @Test - public void operator_multiply_short_Number() throws Exception { - assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_multiply_short_Short() throws Exception { - assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); - } - - @Test - public void operator_multiply_short_AtomicInteger() throws Exception { - assertEquals(12, operator_multiply(left, new AtomicInteger(right))); - } - - @Test - public void operator_multiply_short_AtomicLong() throws Exception { - assertEquals(12l, operator_multiply(left, new AtomicLong(right))); - } - - @Test - public void operator_modulo_short_Long() throws Exception { - assertEquals(1l, operator_modulo(left, Long.valueOf(right))); - } - - @Test - public void operator_modulo_short_Byte() throws Exception { - assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_modulo_short_Float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); - } - - @Test - public void operator_modulo_short_Integer() throws Exception { - assertEquals(1, operator_modulo(left, Integer.valueOf(right))); - } - - @Test - public void operator_modulo_short_Number() throws Exception { - assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_modulo_short_Short() throws Exception { - assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); - } - - @Test - public void operator_modulo_short_AtomicInteger() throws Exception { - assertEquals(1, operator_modulo(left, new AtomicInteger(right))); - } - - @Test - public void operator_modulo_short_AtomicLong() throws Exception { - assertEquals(1l, operator_modulo(left, new AtomicLong(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final short left, final AtomicDouble right) {", - " return (left - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final short left, final Long right) {", - " return (left - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Byte right) {", - " return (left - right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final short left, final Float right) {", - " return (left - right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Integer right) {", - " return (left - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Short right) {", - " return (left - right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final AtomicInteger right) {", - " return (left - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final short left, final AtomicLong right) {", - " return (left - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final short left, final Long right) {", - " return (left + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Byte right) {", - " return (left + right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final short left, final Float right) {", - " return (left + right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Integer right) {", - " return (left + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Short right) {", - " return (left + right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final AtomicInteger right) {", - " return (left + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final short left, final Long right) {", - " return (left + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final short left, final AtomicDouble right) {", - " return (left + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final short left, final AtomicDouble right) {", - " return Math.pow(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final short left, final Long right) {", - " return (left / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Byte right) {", - " return (left / right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final short left, final Float right) {", - " return (left / right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Integer right) {", - " return (left / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final short left, final AtomicDouble right) {", - " return (left / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Short right) {", - " return (left / right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final AtomicInteger right) {", - " return (left / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final short left, final AtomicLong right) {", - " return (left / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final short left, final Long right) {", - " return (left * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Byte right) {", - " return (left * right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final short left, final Float right) {", - " return (left * right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Integer right) {", - " return (left * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final short left, final AtomicDouble right) {", - " return (left * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Short right) {", - " return (left * right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final AtomicInteger right) {", - " return (left * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final short left, final AtomicLong right) {", - " return (left * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final short left, final Long right) {", - " return (left % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Byte right) {", - " return (left % right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final short left, final Float right) {", - " return (left % right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Integer right) {", - " return (left % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final short left, final AtomicDouble right) {", - " return (left % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Short right) {", - " return (left % right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final AtomicInteger right) {", - " return (left % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final short left, final AtomicLong right) {", - " return (left % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/ShortArithmeticExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/ShortArithmeticExtensionsTest.java deleted file mode 100644 index 228a2b9108..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/ShortArithmeticExtensionsTest.java +++ /dev/null @@ -1,2747 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic; - -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions.operator_power; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions.operator_divide; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions.operator_minus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions.operator_modulo; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions.operator_multiply; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions.operator_plus; -import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions.operator_power; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - ShortArithmeticExtensionsTest.Code.class, - ShortArithmeticExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class ShortArithmeticExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Short left = 4; - - private static int right = 3; - - @Test - public void operator_minus_Short() throws Exception { - assertEquals(-4, operator_minus(left)); - } - - @Test - public void operator_minus_Short_Number() throws Exception { - assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_minus_Short_long() throws Exception { - assertEquals(1, operator_minus(left, (long) right)); - } - - @Test - public void operator_minus_Short_Long() throws Exception { - assertEquals(1, operator_minus(left, Long.valueOf(right))); - } - - @Test - public void operator_minus_Short_byte() throws Exception { - assertEquals(1, operator_minus(left, (byte)right)); - } - - @Test - public void operator_minus_Short_Byte() throws Exception { - assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); - } - - @Test - public void operator_minus_Short_float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, (float) right)); - } - - @Test - public void operator_minus_Short_Float() throws Exception { - assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); - } - - @Test - public void operator_minus_Short_int() throws Exception { - assertEquals(1, operator_minus(left, (int) right)); - } - - @Test - public void operator_minus_Short_Integer() throws Exception { - assertEquals(1, operator_minus(left, Integer.valueOf(right))); - } - - @Test - public void operator_minus_Short_short() throws Exception { - assertEquals(1, operator_minus(left, (short) right)); - } - - @Test - public void operator_minus_Short_Short() throws Exception { - assertEquals(1, operator_minus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_minus_Short_AtomicInteger() throws Exception { - assertEquals(1, operator_minus(left, new AtomicInteger(right))); - } - - @Test - public void operator_minus_Short_AtomicLong() throws Exception { - assertEquals(1l, operator_minus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_Short_long() throws Exception { - assertEquals(7l, operator_plus(left, (long) right)); - } - - @Test - public void operator_plus_Short_Long() throws Exception { - assertEquals(7l, operator_plus(left, Long.valueOf(right))); - } - - @Test - public void operator_plus_Short_byte() throws Exception { - assertEquals(7, operator_plus(left, (byte) right)); - } - - @Test - public void operator_plus_Short_Byte() throws Exception { - assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_plus_Short_float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, (float) right)); - } - - @Test - public void operator_plus_Short_Float() throws Exception { - assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); - } - - @Test - public void operator_plus_Short_int() throws Exception { - assertEquals(7, operator_plus(left, (int) right)); - } - - @Test - public void operator_plus_Short_Integer() throws Exception { - assertEquals(7, operator_plus(left, Integer.valueOf(right))); - } - - @Test - public void operator_plus_Short_short() throws Exception { - assertEquals(7, operator_plus(left, (short) right)); - } - - @Test - public void operator_plus_Short_Short() throws Exception { - assertEquals(7, operator_plus(left, Short.valueOf((short) right))); - } - - @Test - public void operator_plus_Short_AtomicInteger() throws Exception { - assertEquals(7, operator_plus(left, new AtomicInteger(right))); - } - - @Test - public void operator_plus_Short_AtomicLong() throws Exception { - assertEquals(7l, operator_plus(left, new AtomicLong(right))); - } - - @Test - public void operator_plus_Short_Number() throws Exception { - assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); - } - - @Test - public void operator_power_Short_Number() throws Exception { - assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); - } - - - @Test - public void operator_power_Short_byte() throws Exception { - assertEpsilonEquals(64., operator_power(left, (byte) right)); - } - - @Test - public void operator_power_Short_short() throws Exception { - assertEpsilonEquals(64., operator_power(left, (short) right)); - } - - @Test - public void operator_power_Short_int() throws Exception { - assertEpsilonEquals(64., operator_power(left, (int) right)); - } - - @Test - public void operator_power_Short_long() throws Exception { - assertEpsilonEquals(64., operator_power(left, (long) right)); - } - - @Test - public void operator_power_Short_float() throws Exception { - assertEpsilonEquals(64., operator_power(left, (float) right)); - } - - @Test - public void operator_power_Short_double() throws Exception { - assertEpsilonEquals(64., operator_power(left, (double) right)); - } - - @Test - public void operator_divide_Short_long() throws Exception { - assertEquals(1l, operator_divide(left, (long) right)); - } - - @Test - public void operator_divide_Short_Long() throws Exception { - assertEquals(1l, operator_divide(left, Long.valueOf(right))); - } - - @Test - public void operator_divide_Short_byte() throws Exception { - assertEquals(1l, operator_divide(left, (byte) right)); - } - - @Test - public void operator_divide_Short_Byte() throws Exception { - assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_divide_Short_float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, (float) right)); - } - - @Test - public void operator_divide_Short_Float() throws Exception { - assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); - } - - @Test - public void operator_divide_Short_int() throws Exception { - assertEquals(1, operator_divide(left, (int) right)); - } - - @Test - public void operator_divide_Short_Integer() throws Exception { - assertEquals(1, operator_divide(left, Integer.valueOf(right))); - } - - @Test - public void operator_divide_Short_Number() throws Exception { - assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_divide_Short_short() throws Exception { - assertEquals(1, operator_divide(left, (short) right)); - } - - @Test - public void operator_divide_Short_Short() throws Exception { - assertEquals(1, operator_divide(left, Short.valueOf((short) right))); - } - - @Test - public void operator_divide_Short_AtomicInteger() throws Exception { - assertEquals(1, operator_divide(left, new AtomicInteger(right))); - } - - @Test - public void operator_divide_Short_AtomicLong() throws Exception { - assertEquals(1l, operator_divide(left, new AtomicLong(right))); - } - - @Test - public void operator_multiply_Short_long() throws Exception { - assertEquals(12l, operator_multiply(left, (long) right)); - } - - @Test - public void operator_multiply_Short_Long() throws Exception { - assertEquals(12l, operator_multiply(left, Long.valueOf(right))); - } - - @Test - public void operator_multiply_Short_byte() throws Exception { - assertEquals(12, operator_multiply(left, (byte) right)); - } - - @Test - public void operator_multiply_Short_Byte() throws Exception { - assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_multiply_Short_float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, (float) right)); - } - - @Test - public void operator_multiply_Short_Float() throws Exception { - assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); - } - - @Test - public void operator_multiply_Short_int() throws Exception { - assertEquals(12, operator_multiply(left, (int) right)); - } - - @Test - public void operator_multiply_Short_Integer() throws Exception { - assertEquals(12, operator_multiply(left, Integer.valueOf(right))); - } - - @Test - public void operator_multiply_Short_Number() throws Exception { - assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); - } - - @Test - public void operator_multiply_Short_short() throws Exception { - assertEquals(12, operator_multiply(left, (short) right)); - } - - @Test - public void operator_multiply_Short_Short() throws Exception { - assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); - } - - @Test - public void operator_multiply_Short_AtomicInteger() throws Exception { - assertEquals(12, operator_multiply(left, new AtomicInteger(right))); - } - - @Test - public void operator_multiply_Short_AtomicLong() throws Exception { - assertEquals(12l, operator_multiply(left, new AtomicLong(right))); - } - - @Test - public void operator_modulo_Short_long() throws Exception { - assertEquals(1l, operator_modulo(left, (long) right)); - } - - @Test - public void operator_modulo_Short_Long() throws Exception { - assertEquals(1l, operator_modulo(left, Long.valueOf(right))); - } - - @Test - public void operator_modulo_Short_byte() throws Exception { - assertEquals(1l, operator_modulo(left, (byte) right)); - } - - @Test - public void operator_modulo_Short_Byte() throws Exception { - assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); - } - - @Test - public void operator_modulo_Short_float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, (float) right)); - } - - @Test - public void operator_modulo_Short_Float() throws Exception { - assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); - } - - @Test - public void operator_modulo_Short_int() throws Exception { - assertEquals(1, operator_modulo(left, (int) right)); - } - - @Test - public void operator_modulo_Short_Integer() throws Exception { - assertEquals(1, operator_modulo(left, Integer.valueOf(right))); - } - - @Test - public void operator_modulo_Short_Number() throws Exception { - assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); - } - - @Test - public void operator_modulo_Short_short() throws Exception { - assertEquals(1, operator_modulo(left, (short) right)); - } - - @Test - public void operator_modulo_Short_Short() throws Exception { - assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); - } - - @Test - public void operator_modulo_Short_AtomicInteger() throws Exception { - assertEquals(1, operator_modulo(left, new AtomicInteger(right))); - } - - @Test - public void operator_modulo_Short_AtomicLong() throws Exception { - assertEquals(1l, operator_modulo(left, new AtomicLong(right))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_minus_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short) : int {", - " -left", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left) {", - " return (-(left.shortValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short, right : AtomicDouble) : double {", - " left - right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Short left, final AtomicDouble right) {", - " return (left.shortValue() - right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final long right) {", - " return (left.shortValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Long) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final Long right) {", - " return (left.shortValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : byte) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final byte right) {", - " return (left.shortValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Byte) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Byte right) {", - " return (left.shortValue() - right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Short left, final float right) {", - " return (left.shortValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Float) : float {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Short left, final Float right) {", - " return (left.shortValue() - right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : int) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final int right) {", - " return (left.shortValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Integer) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Integer right) {", - " return (left.shortValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : short) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final short right) {", - " return (left.shortValue() - right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Short) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Short right) {", - " return (left.shortValue() - right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Short, right : AtomicInteger) : int {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final AtomicInteger right) {", - " return (left.shortValue() - right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_minus_Short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Short, right : AtomicLong) : long {", - " left - right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final AtomicLong right) {", - " return (left.shortValue() - right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final Long right) {", - " return (left.shortValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final long right) {", - " return (left.shortValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : byte) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final byte right) {", - " return (left.shortValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Byte) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Byte right) {", - " return (left.shortValue() + right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Short left, final Float right) {", - " return (left.shortValue() + right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : float) : float {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Short left, final float right) {", - " return (left.shortValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Integer) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Integer right) {", - " return (left.shortValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : int) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final int right) {", - " return (left.shortValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : short) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final short right) {", - " return (left.shortValue() + right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Short) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Short right) {", - " return (left.shortValue() + right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Short, right : AtomicInteger) : int {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final AtomicInteger right) {", - " return (left.shortValue() + right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Long) : long {", - " left + right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final Long right) {", - " return (left.shortValue() + right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_plus_Short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short, right : AtomicDouble) : double {", - " left + right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Short left, final AtomicDouble right) {", - " return (left.shortValue() + right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short, right : AtomicDouble) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Short left, final AtomicDouble right) {", - " return Math.pow(left.shortValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : byte) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Short left, final byte right) {", - " return Math.pow(left.shortValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : short) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Short left, final short right) {", - " return Math.pow(left.shortValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : int) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Short left, final int right) {", - " return Math.pow(left.shortValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : long) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Short left, final long right) {", - " return Math.pow(left.shortValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : float) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Short left, final float right) {", - " return Math.pow(left.shortValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_power_Short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : double) : double {", - " left ** right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Short left, final double right) {", - " return Math.pow(left.shortValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final long right) {", - " return (left.shortValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Long) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final Long right) {", - " return (left.shortValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : byte) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final byte right) {", - " return (left.shortValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Byte) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Byte right) {", - " return (left.shortValue() / right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Short left, final float right) {", - " return (left.shortValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Float) : float {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Short left, final Float right) {", - " return (left.shortValue() / right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : int) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final int right) {", - " return (left.shortValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Integer) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Integer right) {", - " return (left.shortValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short, right : AtomicDouble) : double {", - " left / right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Short left, final AtomicDouble right) {", - " return (left.shortValue() / right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : short) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final short right) {", - " return (left.shortValue() / right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Short) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Short right) {", - " return (left.shortValue() / right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Short, right : AtomicInteger) : int {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final AtomicInteger right) {", - " return (left.shortValue() / right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_divide_Short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Short, right : AtomicLong) : long {", - " left / right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final AtomicLong right) {", - " return (left.shortValue() / right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final long right) {", - " return (left.shortValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Long) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final Long right) {", - " return (left.shortValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : byte) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final byte right) {", - " return (left.shortValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Byte) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Byte right) {", - " return (left.shortValue() * right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Short left, final float right) {", - " return (left.shortValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Float) : float {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Short left, final Float right) {", - " return (left.shortValue() * right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : int) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final int right) {", - " return (left.shortValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Integer) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Integer right) {", - " return (left.shortValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short, right : AtomicDouble) : double {", - " left * right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Short left, final AtomicDouble right) {", - " return (left.shortValue() * right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : short) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final short right) {", - " return (left.shortValue() * right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Short) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Short right) {", - " return (left.shortValue() * right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Short, right : AtomicInteger) : int {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final AtomicInteger right) {", - " return (left.shortValue() * right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_multiply_Short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Short, right : AtomicLong) : long {", - " left * right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final AtomicLong right) {", - " return (left.shortValue() * right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final long right) {", - " return (left.shortValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Long) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final Long right) {", - " return (left.shortValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Byte) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Byte right) {", - " return (left.shortValue() % right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : byte) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final byte right) {", - " return (left.shortValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Short left, final float right) {", - " return (left.shortValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Float) : float {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Short left, final Float right) {", - " return (left.shortValue() % right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : int) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final int right) {", - " return (left.shortValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Integer) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Integer right) {", - " return (left.shortValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short, right : AtomicDouble) : double {", - " left % right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Short left, final AtomicDouble right) {", - " return (left.shortValue() % right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : short) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final short right) {", - " return (left.shortValue() % right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Short) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Short right) {", - " return (left.shortValue() % right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Short, right : AtomicInteger) : int {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final AtomicInteger right) {", - " return (left.shortValue() % right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_modulo_Short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Short, right : AtomicLong) : long {", - " left % right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left, final AtomicLong right) {", - " return (left.shortValue() % right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/atomicinteger/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/atomicinteger/CodeTest.java new file mode 100644 index 0000000000..ff26b3438f --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/atomicinteger/CodeTest.java @@ -0,0 +1,418 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.atomicinteger; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicIntegerArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicIntegerArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicIntegerArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicIntegerArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicIntegerArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicIntegerArithmeticExtensions.operator_power; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static AtomicInteger left = new AtomicInteger(4); + + private static int right = 3; + + @Test + public void operator_minus_AtomicInteger() throws Exception { + assertEquals(-4, operator_minus(left)); + } + + @Test + public void operator_minus_AtomicInteger_Number() throws Exception { + assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_minus_AtomicInteger_long() throws Exception { + assertEquals(1, operator_minus(left, (long) right)); + } + + @Test + public void operator_minus_AtomicInteger_Long() throws Exception { + assertEquals(1, operator_minus(left, Long.valueOf(right))); + } + + @Test + public void operator_minus_AtomicInteger_byte() throws Exception { + assertEquals(1, operator_minus(left, (byte)right)); + } + + @Test + public void operator_minus_AtomicInteger_Byte() throws Exception { + assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); + } + + @Test + public void operator_minus_AtomicInteger_float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, (float) right)); + } + + @Test + public void operator_minus_AtomicInteger_Float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); + } + + @Test + public void operator_minus_AtomicInteger_int() throws Exception { + assertEquals(1, operator_minus(left, (int) right)); + } + + @Test + public void operator_minus_AtomicInteger_Integer() throws Exception { + assertEquals(1, operator_minus(left, Integer.valueOf(right))); + } + + @Test + public void operator_minus_AtomicInteger_short() throws Exception { + assertEquals(1, operator_minus(left, (short) right)); + } + + @Test + public void operator_minus_AtomicInteger_Short() throws Exception { + assertEquals(1, operator_minus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_minus_AtomicInteger_AtomicInteger() throws Exception { + assertEquals(1, operator_minus(left, new AtomicInteger(right))); + } + + @Test + public void operator_minus_AtomicInteger_AtomicLong() throws Exception { + assertEquals(1l, operator_minus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_AtomicInteger_long() throws Exception { + assertEquals(7l, operator_plus(left, (long) right)); + } + + @Test + public void operator_plus_AtomicInteger_Long() throws Exception { + assertEquals(7l, operator_plus(left, Long.valueOf(right))); + } + + @Test + public void operator_plus_AtomicInteger_byte() throws Exception { + assertEquals(7, operator_plus(left, (byte) right)); + } + + @Test + public void operator_plus_AtomicInteger_Byte() throws Exception { + assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_plus_AtomicInteger_float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, (float) right)); + } + + @Test + public void operator_plus_AtomicInteger_Float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); + } + + @Test + public void operator_plus_AtomicInteger_int() throws Exception { + assertEquals(7, operator_plus(left, (int) right)); + } + + @Test + public void operator_plus_AtomicInteger_Integer() throws Exception { + assertEquals(7, operator_plus(left, Integer.valueOf(right))); + } + + @Test + public void operator_plus_AtomicInteger_short() throws Exception { + assertEquals(7, operator_plus(left, (short) right)); + } + + @Test + public void operator_plus_AtomicInteger_Short() throws Exception { + assertEquals(7, operator_plus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_plus_AtomicInteger_AtomicInteger() throws Exception { + assertEquals(7, operator_plus(left, new AtomicInteger(right))); + } + + @Test + public void operator_plus_AtomicInteger_AtomicLong() throws Exception { + assertEquals(7l, operator_plus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_AtomicInteger_Number() throws Exception { + assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_AtomicInteger_Number() throws Exception { + assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); + } + + + @Test + public void operator_power_AtomicInteger_byte() throws Exception { + assertEpsilonEquals(64., operator_power(left, (byte) right)); + } + + @Test + public void operator_power_AtomicInteger_short() throws Exception { + assertEpsilonEquals(64., operator_power(left, (short) right)); + } + + @Test + public void operator_power_AtomicInteger_int() throws Exception { + assertEpsilonEquals(64., operator_power(left, (int) right)); + } + + @Test + public void operator_power_AtomicInteger_long() throws Exception { + assertEpsilonEquals(64., operator_power(left, (long) right)); + } + + @Test + public void operator_power_AtomicInteger_float() throws Exception { + assertEpsilonEquals(64., operator_power(left, (float) right)); + } + + @Test + public void operator_power_AtomicInteger_double() throws Exception { + assertEpsilonEquals(64., operator_power(left, (double) right)); + } + + @Test + public void operator_divide_AtomicInteger_long() throws Exception { + assertEquals(1l, operator_divide(left, (long) right)); + } + + @Test + public void operator_divide_AtomicInteger_Long() throws Exception { + assertEquals(1l, operator_divide(left, Long.valueOf(right))); + } + + @Test + public void operator_divide_AtomicInteger_byte() throws Exception { + assertEquals(1l, operator_divide(left, (byte) right)); + } + + @Test + public void operator_divide_AtomicInteger_Byte() throws Exception { + assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_divide_AtomicInteger_float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, (float) right)); + } + + @Test + public void operator_divide_AtomicInteger_Float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); + } + + @Test + public void operator_divide_AtomicInteger_int() throws Exception { + assertEquals(1, operator_divide(left, (int) right)); + } + + @Test + public void operator_divide_AtomicInteger_Integer() throws Exception { + assertEquals(1, operator_divide(left, Integer.valueOf(right))); + } + + @Test + public void operator_divide_AtomicInteger_Number() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_divide_AtomicInteger_short() throws Exception { + assertEquals(1, operator_divide(left, (short) right)); + } + + @Test + public void operator_divide_AtomicInteger_Short() throws Exception { + assertEquals(1, operator_divide(left, Short.valueOf((short) right))); + } + + @Test + public void operator_divide_AtomicInteger_AtomicInteger() throws Exception { + assertEquals(1, operator_divide(left, new AtomicInteger(right))); + } + + @Test + public void operator_divide_AtomicInteger_AtomicLong() throws Exception { + assertEquals(1l, operator_divide(left, new AtomicLong(right))); + } + + @Test + public void operator_multiply_AtomicInteger_long() throws Exception { + assertEquals(12l, operator_multiply(left, (long) right)); + } + + @Test + public void operator_multiply_AtomicInteger_Long() throws Exception { + assertEquals(12l, operator_multiply(left, Long.valueOf(right))); + } + + @Test + public void operator_multiply_AtomicInteger_byte() throws Exception { + assertEquals(12, operator_multiply(left, (byte) right)); + } + + @Test + public void operator_multiply_AtomicInteger_Byte() throws Exception { + assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_multiply_AtomicInteger_float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, (float) right)); + } + + @Test + public void operator_multiply_AtomicInteger_Float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); + } + + @Test + public void operator_multiply_AtomicInteger_int() throws Exception { + assertEquals(12, operator_multiply(left, (int) right)); + } + + @Test + public void operator_multiply_AtomicInteger_Integer() throws Exception { + assertEquals(12, operator_multiply(left, Integer.valueOf(right))); + } + + @Test + public void operator_multiply_AtomicInteger_Number() throws Exception { + assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_multiply_AtomicInteger_short() throws Exception { + assertEquals(12, operator_multiply(left, (short) right)); + } + + @Test + public void operator_multiply_AtomicInteger_Short() throws Exception { + assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); + } + + @Test + public void operator_multiply_AtomicInteger_AtomicInteger() throws Exception { + assertEquals(12, operator_multiply(left, new AtomicInteger(right))); + } + + @Test + public void operator_multiply_AtomicInteger_AtomicLong() throws Exception { + assertEquals(12l, operator_multiply(left, new AtomicLong(right))); + } + + @Test + public void operator_modulo_AtomicInteger_long() throws Exception { + assertEquals(1l, operator_modulo(left, (long) right)); + } + + @Test + public void operator_modulo_AtomicInteger_Long() throws Exception { + assertEquals(1l, operator_modulo(left, Long.valueOf(right))); + } + + @Test + public void operator_modulo_AtomicInteger_byte() throws Exception { + assertEquals(1l, operator_modulo(left, (byte) right)); + } + + @Test + public void operator_modulo_AtomicInteger_Byte() throws Exception { + assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_modulo_AtomicInteger_float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, (float) right)); + } + + @Test + public void operator_modulo_AtomicInteger_Float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); + } + + @Test + public void operator_modulo_AtomicInteger_int() throws Exception { + assertEquals(1, operator_modulo(left, (int) right)); + } + + @Test + public void operator_modulo_AtomicInteger_Integer() throws Exception { + assertEquals(1, operator_modulo(left, Integer.valueOf(right))); + } + + @Test + public void operator_modulo_AtomicInteger_Number() throws Exception { + assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_modulo_AtomicInteger_short() throws Exception { + assertEquals(1, operator_modulo(left, (short) right)); + } + + @Test + public void operator_modulo_AtomicInteger_Short() throws Exception { + assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); + } + + @Test + public void operator_modulo_AtomicInteger_AtomicInteger() throws Exception { + assertEquals(1, operator_modulo(left, new AtomicInteger(right))); + } + + @Test + public void operator_modulo_AtomicInteger_AtomicLong() throws Exception { + assertEquals(1l, operator_modulo(left, new AtomicLong(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/atomicinteger/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/atomicinteger/CompilerTest.java new file mode 100644 index 0000000000..ab81234ea7 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/atomicinteger/CompilerTest.java @@ -0,0 +1,2470 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.atomicinteger; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : int {", + " -left", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left) {", + " return (-(left.intValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicInteger_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicInteger left, final AtomicDouble right) {", + " return (left.intValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicInteger_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final long right) {", + " return (left.intValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicInteger_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final Long right) {", + " return (left.intValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicInteger_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : byte) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final byte right) {", + " return (left.intValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicInteger_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Byte) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Byte right) {", + " return (left.intValue() - right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicInteger_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicInteger left, final float right) {", + " return (left.intValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicInteger_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicInteger left, final Float right) {", + " return (left.intValue() - right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicInteger_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : int) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final int right) {", + " return (left.intValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicInteger_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Integer) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Integer right) {", + " return (left.intValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicInteger_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : short) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final short right) {", + " return (left.intValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicInteger_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Short) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Short right) {", + " return (left.intValue() - right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicInteger_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : AtomicInteger) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final AtomicInteger right) {", + " return (left.intValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicInteger_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicInteger, right : AtomicLong) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final AtomicLong right) {", + " return (left.intValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicInteger_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final Long right) {", + " return (left.intValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicInteger_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final long right) {", + " return (left.intValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicInteger_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : byte) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final byte right) {", + " return (left.intValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicInteger_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Byte) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Byte right) {", + " return (left.intValue() + right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicInteger_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicInteger left, final Float right) {", + " return (left.intValue() + right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicInteger_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicInteger left, final float right) {", + " return (left.intValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicInteger_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Integer) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Integer right) {", + " return (left.intValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicInteger_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : int) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final int right) {", + " return (left.intValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicInteger_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : short) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final short right) {", + " return (left.intValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicInteger_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Short) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Short right) {", + " return (left.intValue() + right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicInteger_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : AtomicInteger) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final AtomicInteger right) {", + " return (left.intValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicInteger_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final Long right) {", + " return (left.intValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicInteger_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicInteger left, final AtomicDouble right) {", + " return (left.intValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicInteger_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicInteger left, final AtomicDouble right) {", + " return Math.pow(left.intValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicInteger_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : byte) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicInteger left, final byte right) {", + " return Math.pow(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicInteger_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : short) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicInteger left, final short right) {", + " return Math.pow(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicInteger_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : int) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicInteger left, final int right) {", + " return Math.pow(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicInteger_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : long) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicInteger left, final long right) {", + " return Math.pow(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicInteger_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : float) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicInteger left, final float right) {", + " return Math.pow(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicInteger_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : double) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicInteger left, final double right) {", + " return Math.pow(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicInteger_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final long right) {", + " return (left.intValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicInteger_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final Long right) {", + " return (left.intValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicInteger_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : byte) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final byte right) {", + " return (left.intValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicInteger_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Byte) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Byte right) {", + " return (left.intValue() / right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicInteger_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicInteger left, final float right) {", + " return (left.intValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicInteger_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicInteger left, final Float right) {", + " return (left.intValue() / right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicInteger_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : int) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final int right) {", + " return (left.intValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicInteger_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Integer) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Integer right) {", + " return (left.intValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicInteger_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicInteger left, final AtomicDouble right) {", + " return (left.intValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicInteger_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : short) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final short right) {", + " return (left.intValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicInteger_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Short) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Short right) {", + " return (left.intValue() / right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicInteger_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : AtomicInteger) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final AtomicInteger right) {", + " return (left.intValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicInteger_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicInteger, right : AtomicLong) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final AtomicLong right) {", + " return (left.intValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicInteger_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final long right) {", + " return (left.intValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicInteger_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final Long right) {", + " return (left.intValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicInteger_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : byte) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final byte right) {", + " return (left.intValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicInteger_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Byte) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Byte right) {", + " return (left.intValue() * right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicInteger_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicInteger left, final float right) {", + " return (left.intValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicInteger_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicInteger left, final Float right) {", + " return (left.intValue() * right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicInteger_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : int) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final int right) {", + " return (left.intValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicInteger_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Integer) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Integer right) {", + " return (left.intValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicInteger_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicInteger left, final AtomicDouble right) {", + " return (left.intValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicInteger_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : short) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final short right) {", + " return (left.intValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicInteger_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Short) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Short right) {", + " return (left.intValue() * right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicInteger_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : AtomicInteger) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final AtomicInteger right) {", + " return (left.intValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicInteger_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicInteger, right : AtomicLong) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final AtomicLong right) {", + " return (left.intValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicInteger_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final long right) {", + " return (left.intValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicInteger_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final Long right) {", + " return (left.intValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicInteger_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Byte) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Byte right) {", + " return (left.intValue() % right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicInteger_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : byte) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final byte right) {", + " return (left.intValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicInteger_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicInteger left, final float right) {", + " return (left.intValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicInteger_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicInteger left, final Float right) {", + " return (left.intValue() % right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicInteger_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : int) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final int right) {", + " return (left.intValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicInteger_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Integer) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Integer right) {", + " return (left.intValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicInteger_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicInteger left, final AtomicDouble right) {", + " return (left.intValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicInteger_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : short) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final short right) {", + " return (left.intValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicInteger_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : Short) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final Short right) {", + " return (left.intValue() % right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicInteger_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger, right : AtomicInteger) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final AtomicInteger left, final AtomicInteger right) {", + " return (left.intValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicInteger_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicInteger, right : AtomicLong) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicInteger left, final AtomicLong right) {", + " return (left.intValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/atomiclong/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/atomiclong/CodeTest.java new file mode 100644 index 0000000000..e9dbb1b4c6 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/atomiclong/CodeTest.java @@ -0,0 +1,417 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.atomiclong; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicLongArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicLongArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicLongArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicLongArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicLongArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.AtomicLongArithmeticExtensions.operator_power; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static AtomicLong left = new AtomicLong(4); + + private static int right = 3; + + @Test + public void operator_minus_AtomicLong() throws Exception { + assertEquals(-4, operator_minus(left)); + } + + @Test + public void operator_minus_AtomicLong_Number() throws Exception { + assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_minus_AtomicLong_long() throws Exception { + assertEquals(1, operator_minus(left, (long) right)); + } + + @Test + public void operator_minus_AtomicLong_Long() throws Exception { + assertEquals(1, operator_minus(left, Long.valueOf(right))); + } + + @Test + public void operator_minus_AtomicLong_byte() throws Exception { + assertEquals(1, operator_minus(left, (byte)right)); + } + + @Test + public void operator_minus_AtomicLong_Byte() throws Exception { + assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); + } + + @Test + public void operator_minus_AtomicLong_float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, (float) right)); + } + + @Test + public void operator_minus_AtomicLong_Float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); + } + + @Test + public void operator_minus_AtomicLong_int() throws Exception { + assertEquals(1, operator_minus(left, (int) right)); + } + + @Test + public void operator_minus_AtomicLong_Integer() throws Exception { + assertEquals(1, operator_minus(left, Integer.valueOf(right))); + } + + @Test + public void operator_minus_AtomicLong_short() throws Exception { + assertEquals(1, operator_minus(left, (short) right)); + } + + @Test + public void operator_minus_AtomicLong_Short() throws Exception { + assertEquals(1, operator_minus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_minus_AtomicLong_AtomicInteger() throws Exception { + assertEquals(1, operator_minus(left, new AtomicInteger(right))); + } + + @Test + public void operator_minus_AtomicLong_AtomicLong() throws Exception { + assertEquals(1l, operator_minus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_AtomicLong_long() throws Exception { + assertEquals(7l, operator_plus(left, (long) right)); + } + + @Test + public void operator_plus_AtomicLong_Long() throws Exception { + assertEquals(7l, operator_plus(left, Long.valueOf(right))); + } + + @Test + public void operator_plus_AtomicLong_byte() throws Exception { + assertEquals(7, operator_plus(left, (byte) right)); + } + + @Test + public void operator_plus_AtomicLong_Byte() throws Exception { + assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_plus_AtomicLong_float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, (float) right)); + } + + @Test + public void operator_plus_AtomicLong_Float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); + } + + @Test + public void operator_plus_AtomicLong_int() throws Exception { + assertEquals(7, operator_plus(left, (int) right)); + } + + @Test + public void operator_plus_AtomicLong_Integer() throws Exception { + assertEquals(7, operator_plus(left, Integer.valueOf(right))); + } + + @Test + public void operator_plus_AtomicLong_short() throws Exception { + assertEquals(7, operator_plus(left, (short) right)); + } + + @Test + public void operator_plus_AtomicLong_Short() throws Exception { + assertEquals(7, operator_plus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_plus_AtomicLong_AtomicInteger() throws Exception { + assertEquals(7, operator_plus(left, new AtomicInteger(right))); + } + + @Test + public void operator_plus_AtomicLong_AtomicLong() throws Exception { + assertEquals(7l, operator_plus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_AtomicLong_Number() throws Exception { + assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_AtomicLong_Number() throws Exception { + assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_power_AtomicLong_byte() throws Exception { + assertEpsilonEquals(64., operator_power(left, (byte) right)); + } + + @Test + public void operator_power_AtomicLong_short() throws Exception { + assertEpsilonEquals(64., operator_power(left, (short) right)); + } + + @Test + public void operator_power_AtomicLong_int() throws Exception { + assertEpsilonEquals(64., operator_power(left, (int) right)); + } + + @Test + public void operator_power_AtomicLong_long() throws Exception { + assertEpsilonEquals(64., operator_power(left, (long) right)); + } + + @Test + public void operator_power_AtomicLong_float() throws Exception { + assertEpsilonEquals(64., operator_power(left, (float) right)); + } + + @Test + public void operator_power_AtomicLong_double() throws Exception { + assertEpsilonEquals(64., operator_power(left, (double) right)); + } + + @Test + public void operator_divide_AtomicLong_long() throws Exception { + assertEquals(1l, operator_divide(left, (long) right)); + } + + @Test + public void operator_divide_AtomicLong_Long() throws Exception { + assertEquals(1l, operator_divide(left, Long.valueOf(right))); + } + + @Test + public void operator_divide_AtomicLong_byte() throws Exception { + assertEquals(1l, operator_divide(left, (byte) right)); + } + + @Test + public void operator_divide_AtomicLong_Byte() throws Exception { + assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_divide_AtomicLong_float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, (float) right)); + } + + @Test + public void operator_divide_AtomicLong_Float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); + } + + @Test + public void operator_divide_AtomicLong_int() throws Exception { + assertEquals(1, operator_divide(left, (int) right)); + } + + @Test + public void operator_divide_AtomicLong_Integer() throws Exception { + assertEquals(1, operator_divide(left, Integer.valueOf(right))); + } + + @Test + public void operator_divide_AtomicLong_Number() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_divide_AtomicLong_short() throws Exception { + assertEquals(1, operator_divide(left, (short) right)); + } + + @Test + public void operator_divide_AtomicLong_Short() throws Exception { + assertEquals(1, operator_divide(left, Short.valueOf((short) right))); + } + + @Test + public void operator_divide_AtomicLong_AtomicInteger() throws Exception { + assertEquals(1, operator_divide(left, new AtomicInteger(right))); + } + + @Test + public void operator_divide_AtomicLong_AtomicLong() throws Exception { + assertEquals(1l, operator_divide(left, new AtomicLong(right))); + } + + @Test + public void operator_multiply_AtomicLong_long() throws Exception { + assertEquals(12l, operator_multiply(left, (long) right)); + } + + @Test + public void operator_multiply_AtomicLong_Long() throws Exception { + assertEquals(12l, operator_multiply(left, Long.valueOf(right))); + } + + @Test + public void operator_multiply_AtomicLong_byte() throws Exception { + assertEquals(12, operator_multiply(left, (byte) right)); + } + + @Test + public void operator_multiply_AtomicLong_Byte() throws Exception { + assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_multiply_AtomicLong_float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, (float) right)); + } + + @Test + public void operator_multiply_AtomicLong_Float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); + } + + @Test + public void operator_multiply_AtomicLong_int() throws Exception { + assertEquals(12, operator_multiply(left, (int) right)); + } + + @Test + public void operator_multiply_AtomicLong_Integer() throws Exception { + assertEquals(12, operator_multiply(left, Integer.valueOf(right))); + } + + @Test + public void operator_multiply_AtomicLong_Number() throws Exception { + assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_multiply_AtomicLong_short() throws Exception { + assertEquals(12, operator_multiply(left, (short) right)); + } + + @Test + public void operator_multiply_AtomicLong_Short() throws Exception { + assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); + } + + @Test + public void operator_multiply_AtomicLong_AtomicInteger() throws Exception { + assertEquals(12, operator_multiply(left, new AtomicInteger(right))); + } + + @Test + public void operator_multiply_AtomicLong_AtomicLong() throws Exception { + assertEquals(12l, operator_multiply(left, new AtomicLong(right))); + } + + @Test + public void operator_modulo_AtomicLong_long() throws Exception { + assertEquals(1l, operator_modulo(left, (long) right)); + } + + @Test + public void operator_modulo_AtomicLong_Long() throws Exception { + assertEquals(1l, operator_modulo(left, Long.valueOf(right))); + } + + @Test + public void operator_modulo_AtomicLong_byte() throws Exception { + assertEquals(1l, operator_modulo(left, (byte) right)); + } + + @Test + public void operator_modulo_AtomicLong_Byte() throws Exception { + assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_modulo_AtomicLong_float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, (float) right)); + } + + @Test + public void operator_modulo_AtomicLong_Float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); + } + + @Test + public void operator_modulo_AtomicLong_int() throws Exception { + assertEquals(1, operator_modulo(left, (int) right)); + } + + @Test + public void operator_modulo_AtomicLong_Integer() throws Exception { + assertEquals(1, operator_modulo(left, Integer.valueOf(right))); + } + + @Test + public void operator_modulo_AtomicLong_Number() throws Exception { + assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_modulo_AtomicLong_short() throws Exception { + assertEquals(1, operator_modulo(left, (short) right)); + } + + @Test + public void operator_modulo_AtomicLong_Short() throws Exception { + assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); + } + + @Test + public void operator_modulo_AtomicLong_AtomicInteger() throws Exception { + assertEquals(1, operator_modulo(left, new AtomicInteger(right))); + } + + @Test + public void operator_modulo_AtomicLong_AtomicLong() throws Exception { + assertEquals(1l, operator_modulo(left, new AtomicLong(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/atomiclong/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/atomiclong/CompilerTest.java new file mode 100644 index 0000000000..5306d2b201 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/atomiclong/CompilerTest.java @@ -0,0 +1,2472 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.atomiclong; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : long {", + " -left", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left) {", + " return (-(left.longValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicLong_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicLong left, final AtomicDouble right) {", + " return (left.longValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicLong_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final long right) {", + " return (left.longValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicLong_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Long right) {", + " return (left.longValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicLong_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : byte) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final byte right) {", + " return (left.longValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicLong_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Byte) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Byte right) {", + " return (left.longValue() - right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicLong_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicLong left, final float right) {", + " return (left.longValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicLong_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicLong left, final Float right) {", + " return (left.longValue() - right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicLong_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : int) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final int right) {", + " return (left.longValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicLong_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Integer) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Integer right) {", + " return (left.longValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicLong_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : short) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final short right) {", + " return (left.longValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicLong_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Short) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Short right) {", + " return (left.longValue() - right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicLong_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicInteger) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final AtomicInteger right) {", + " return (left.longValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_AtomicLong_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicLong) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final AtomicLong right) {", + " return (left.longValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicLong_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Long right) {", + " return (left.longValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicLong_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final long right) {", + " return (left.longValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicLong_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : byte) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final byte right) {", + " return (left.longValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicLong_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Byte) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Byte right) {", + " return (left.longValue() + right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicLong_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicLong left, final Float right) {", + " return (left.longValue() + right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicLong_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicLong left, final float right) {", + " return (left.longValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicLong_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Integer) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Integer right) {", + " return (left.longValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicLong_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : int) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final int right) {", + " return (left.longValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicLong_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : short) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final short right) {", + " return (left.longValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicLong_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Short) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Short right) {", + " return (left.longValue() + right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicLong_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicInteger) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final AtomicInteger right) {", + " return (left.longValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicLong_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Long right) {", + " return (left.longValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_AtomicLong_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicLong left, final AtomicDouble right) {", + " return (left.longValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicLong_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicLong left, final AtomicDouble right) {", + " return Math.pow(left.longValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicLong_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : byte) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicLong left, final byte right) {", + " return Math.pow(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicLong_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : short) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicLong left, final short right) {", + " return Math.pow(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicLong_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : int) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicLong left, final int right) {", + " return Math.pow(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicLong_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : long) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicLong left, final long right) {", + " return Math.pow(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicLong_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : float) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicLong left, final float right) {", + " return Math.pow(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_AtomicLong_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : double) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicLong left, final double right) {", + " return Math.pow(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicLong_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final long right) {", + " return (left.longValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicLong_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Long right) {", + " return (left.longValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicLong_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : byte) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final byte right) {", + " return (left.longValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicLong_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Byte) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Byte right) {", + " return (left.longValue() / right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicLong_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicLong left, final float right) {", + " return (left.longValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicLong_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicLong left, final Float right) {", + " return (left.longValue() / right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicLong_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : int) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final int right) {", + " return (left.longValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicLong_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Integer) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Integer right) {", + " return (left.longValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicLong_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicLong left, final AtomicDouble right) {", + " return (left.longValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicLong_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : short) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final short right) {", + " return (left.longValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicLong_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Short) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Short right) {", + " return (left.longValue() / right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicLong_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicInteger) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final AtomicInteger right) {", + " return (left.longValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_AtomicLong_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicLong) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final AtomicLong right) {", + " return (left.longValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicLong_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final long right) {", + " return (left.longValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicLong_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Long right) {", + " return (left.longValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicLong_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : byte) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final byte right) {", + " return (left.longValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicLong_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Byte) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Byte right) {", + " return (left.longValue() * right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicLong_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicLong left, final float right) {", + " return (left.longValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicLong_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicLong left, final Float right) {", + " return (left.longValue() * right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicLong_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : int) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final int right) {", + " return (left.longValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicLong_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Integer) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Integer right) {", + " return (left.longValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicLong_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicLong left, final AtomicDouble right) {", + " return (left.longValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicLong_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : short) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final short right) {", + " return (left.longValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicLong_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Short) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Short right) {", + " return (left.longValue() * right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicLong_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicInteger) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final AtomicInteger right) {", + " return (left.longValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_AtomicLong_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicLong) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final AtomicLong right) {", + " return (left.longValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicLong_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final long right) {", + " return (left.longValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicLong_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Long right) {", + " return (left.longValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicLong_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Byte) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Byte right) {", + " return (left.longValue() % right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicLong_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : byte) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final byte right) {", + " return (left.longValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicLong_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicLong left, final float right) {", + " return (left.longValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicLong_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final AtomicLong left, final Float right) {", + " return (left.longValue() % right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicLong_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : int) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final int right) {", + " return (left.longValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicLong_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Integer) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Integer right) {", + " return (left.longValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicLong_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final AtomicLong left, final AtomicDouble right) {", + " return (left.longValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicLong_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : short) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final short right) {", + " return (left.longValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicLong_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : Short) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final Short right) {", + " return (left.longValue() % right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicLong_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicInteger) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final AtomicInteger right) {", + " return (left.longValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_AtomicLong_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong, right : AtomicLong) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final AtomicLong left, final AtomicLong right) {", + " return (left.longValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/byteobject/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/byteobject/CodeTest.java new file mode 100644 index 0000000000..95de6a5ecd --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/byteobject/CodeTest.java @@ -0,0 +1,417 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.byteobject; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ByteArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ByteArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ByteArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ByteArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ByteArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ByteArithmeticExtensions.operator_power; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Byte left = 4; + + private static int right = 3; + + @Test + public void operator_minus_Byte() throws Exception { + assertEquals(-4, operator_minus(left)); + } + + @Test + public void operator_minus_Byte_Number() throws Exception { + assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_minus_Byte_long() throws Exception { + assertEquals(1, operator_minus(left, (long) right)); + } + + @Test + public void operator_minus_Byte_Long() throws Exception { + assertEquals(1, operator_minus(left, Long.valueOf(right))); + } + + @Test + public void operator_minus_Byte_byte() throws Exception { + assertEquals(1, operator_minus(left, (byte)right)); + } + + @Test + public void operator_minus_Byte_Byte() throws Exception { + assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); + } + + @Test + public void operator_minus_Byte_float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, (float) right)); + } + + @Test + public void operator_minus_Byte_Float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); + } + + @Test + public void operator_minus_Byte_int() throws Exception { + assertEquals(1, operator_minus(left, (int) right)); + } + + @Test + public void operator_minus_Byte_Integer() throws Exception { + assertEquals(1, operator_minus(left, Integer.valueOf(right))); + } + + @Test + public void operator_minus_Byte_short() throws Exception { + assertEquals(1, operator_minus(left, (short) right)); + } + + @Test + public void operator_minus_Byte_Short() throws Exception { + assertEquals(1, operator_minus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_minus_Byte_AtomicInteger() throws Exception { + assertEquals(1, operator_minus(left, new AtomicInteger(right))); + } + + @Test + public void operator_minus_Byte_AtomicLong() throws Exception { + assertEquals(1l, operator_minus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_Byte_long() throws Exception { + assertEquals(7l, operator_plus(left, (long) right)); + } + + @Test + public void operator_plus_Byte_Long() throws Exception { + assertEquals(7l, operator_plus(left, Long.valueOf(right))); + } + + @Test + public void operator_plus_Byte_byte() throws Exception { + assertEquals(7, operator_plus(left, (byte) right)); + } + + @Test + public void operator_plus_Byte_Byte() throws Exception { + assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_plus_Byte_float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, (float) right)); + } + + @Test + public void operator_plus_Byte_Float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); + } + + @Test + public void operator_plus_Byte_int() throws Exception { + assertEquals(7, operator_plus(left, (int) right)); + } + + @Test + public void operator_plus_Byte_Integer() throws Exception { + assertEquals(7, operator_plus(left, Integer.valueOf(right))); + } + + @Test + public void operator_plus_Byte_short() throws Exception { + assertEquals(7, operator_plus(left, (short) right)); + } + + @Test + public void operator_plus_Byte_Short() throws Exception { + assertEquals(7, operator_plus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_plus_Byte_AtomicInteger() throws Exception { + assertEquals(7, operator_plus(left, new AtomicInteger(right))); + } + + @Test + public void operator_plus_Byte_AtomicLong() throws Exception { + assertEquals(7l, operator_plus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_Byte_Number() throws Exception { + assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_Byte_Number() throws Exception { + assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_power_Byte_byte() throws Exception { + assertEpsilonEquals(64., operator_power(left, (byte) right)); + } + + @Test + public void operator_power_Byte_short() throws Exception { + assertEpsilonEquals(64., operator_power(left, (short) right)); + } + + @Test + public void operator_power_Byte_int() throws Exception { + assertEpsilonEquals(64., operator_power(left, (int) right)); + } + + @Test + public void operator_power_Byte_long() throws Exception { + assertEpsilonEquals(64., operator_power(left, (long) right)); + } + + @Test + public void operator_power_Byte_float() throws Exception { + assertEpsilonEquals(64., operator_power(left, (float) right)); + } + + @Test + public void operator_power_Byte_double() throws Exception { + assertEpsilonEquals(64., operator_power(left, (double) right)); + } + + @Test + public void operator_divide_Byte_long() throws Exception { + assertEquals(1l, operator_divide(left, (long) right)); + } + + @Test + public void operator_divide_Byte_Long() throws Exception { + assertEquals(1l, operator_divide(left, Long.valueOf(right))); + } + + @Test + public void operator_divide_Byte_byte() throws Exception { + assertEquals(1l, operator_divide(left, (byte) right)); + } + + @Test + public void operator_divide_Byte_Byte() throws Exception { + assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_divide_Byte_float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, (float) right)); + } + + @Test + public void operator_divide_Byte_Float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); + } + + @Test + public void operator_divide_Byte_int() throws Exception { + assertEquals(1, operator_divide(left, (int) right)); + } + + @Test + public void operator_divide_Byte_Integer() throws Exception { + assertEquals(1, operator_divide(left, Integer.valueOf(right))); + } + + @Test + public void operator_divide_Byte_Number() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_divide_Byte_short() throws Exception { + assertEquals(1, operator_divide(left, (short) right)); + } + + @Test + public void operator_divide_Byte_Short() throws Exception { + assertEquals(1, operator_divide(left, Short.valueOf((short) right))); + } + + @Test + public void operator_divide_Byte_AtomicInteger() throws Exception { + assertEquals(1, operator_divide(left, new AtomicInteger(right))); + } + + @Test + public void operator_divide_Byte_AtomicLong() throws Exception { + assertEquals(1l, operator_divide(left, new AtomicLong(right))); + } + + @Test + public void operator_multiply_Byte_long() throws Exception { + assertEquals(12l, operator_multiply(left, (long) right)); + } + + @Test + public void operator_multiply_Byte_Long() throws Exception { + assertEquals(12l, operator_multiply(left, Long.valueOf(right))); + } + + @Test + public void operator_multiply_Byte_byte() throws Exception { + assertEquals(12, operator_multiply(left, (byte) right)); + } + + @Test + public void operator_multiply_Byte_Byte() throws Exception { + assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_multiply_Byte_float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, (float) right)); + } + + @Test + public void operator_multiply_Byte_Float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); + } + + @Test + public void operator_multiply_Byte_int() throws Exception { + assertEquals(12, operator_multiply(left, (int) right)); + } + + @Test + public void operator_multiply_Byte_Integer() throws Exception { + assertEquals(12, operator_multiply(left, Integer.valueOf(right))); + } + + @Test + public void operator_multiply_Byte_Number() throws Exception { + assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_multiply_Byte_short() throws Exception { + assertEquals(12, operator_multiply(left, (short) right)); + } + + @Test + public void operator_multiply_Byte_Short() throws Exception { + assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); + } + + @Test + public void operator_multiply_Byte_AtomicInteger() throws Exception { + assertEquals(12, operator_multiply(left, new AtomicInteger(right))); + } + + @Test + public void operator_multiply_Byte_AtomicLong() throws Exception { + assertEquals(12l, operator_multiply(left, new AtomicLong(right))); + } + + @Test + public void operator_modulo_Byte_long() throws Exception { + assertEquals(1l, operator_modulo(left, (long) right)); + } + + @Test + public void operator_modulo_Byte_Long() throws Exception { + assertEquals(1l, operator_modulo(left, Long.valueOf(right))); + } + + @Test + public void operator_modulo_Byte_byte() throws Exception { + assertEquals(1l, operator_modulo(left, (byte) right)); + } + + @Test + public void operator_modulo_Byte_Byte() throws Exception { + assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_modulo_Byte_float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, (float) right)); + } + + @Test + public void operator_modulo_Byte_Float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); + } + + @Test + public void operator_modulo_Byte_int() throws Exception { + assertEquals(1, operator_modulo(left, (int) right)); + } + + @Test + public void operator_modulo_Byte_Integer() throws Exception { + assertEquals(1, operator_modulo(left, Integer.valueOf(right))); + } + + @Test + public void operator_modulo_Byte_Number() throws Exception { + assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_modulo_Byte_short() throws Exception { + assertEquals(1, operator_modulo(left, (short) right)); + } + + @Test + public void operator_modulo_Byte_Short() throws Exception { + assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); + } + + @Test + public void operator_modulo_Byte_AtomicInteger() throws Exception { + assertEquals(1, operator_modulo(left, new AtomicInteger(right))); + } + + @Test + public void operator_modulo_Byte_AtomicLong() throws Exception { + assertEquals(1l, operator_modulo(left, new AtomicLong(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/byteobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/byteobject/CompilerTest.java new file mode 100644 index 0000000000..cfbe78fd54 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/byteobject/CompilerTest.java @@ -0,0 +1,2333 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.byteobject; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte) : int {", + " -left", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left) {", + " return (-(left.byteValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Byte left, final AtomicDouble right) {", + " return (left.byteValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final long right) {", + " return (left.byteValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final Long right) {", + " return (left.byteValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : byte) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final byte right) {", + " return (left.byteValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Byte) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Byte right) {", + " return (left.byteValue() - right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Byte left, final float right) {", + " return (left.byteValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Byte left, final Float right) {", + " return (left.byteValue() - right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : int) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final int right) {", + " return (left.byteValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Integer) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Integer right) {", + " return (left.byteValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : short) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final short right) {", + " return (left.byteValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Short) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Short right) {", + " return (left.byteValue() - right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Byte, right : AtomicInteger) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final AtomicInteger right) {", + " return (left.byteValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Byte, right : AtomicLong) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final AtomicLong right) {", + " return (left.byteValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final Long right) {", + " return (left.byteValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final long right) {", + " return (left.byteValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : byte) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final byte right) {", + " return (left.byteValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Byte) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Byte right) {", + " return (left.byteValue() + right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Byte left, final Float right) {", + " return (left.byteValue() + right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Byte left, final float right) {", + " return (left.byteValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Integer) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Integer right) {", + " return (left.byteValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : int) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final int right) {", + " return (left.byteValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : short) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final short right) {", + " return (left.byteValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Short) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Short right) {", + " return (left.byteValue() + right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Byte, right : AtomicInteger) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final AtomicInteger right) {", + " return (left.byteValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final Long right) {", + " return (left.byteValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Byte left, final AtomicDouble right) {", + " return (left.byteValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Byte left, final AtomicDouble right) {", + " return Math.pow(left.byteValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : byte) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Byte left, final byte right) {", + " return Math.pow(left.byteValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : short) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Byte left, final short right) {", + " return Math.pow(left.byteValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : int) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Byte left, final int right) {", + " return Math.pow(left.byteValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : long) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Byte left, final long right) {", + " return Math.pow(left.byteValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : float) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Byte left, final float right) {", + " return Math.pow(left.byteValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : double) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Byte left, final double right) {", + " return Math.pow(left.byteValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final long right) {", + " return (left.byteValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final Long right) {", + " return (left.byteValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : byte) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final byte right) {", + " return (left.byteValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Byte) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Byte right) {", + " return (left.byteValue() / right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Byte left, final float right) {", + " return (left.byteValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Byte left, final Float right) {", + " return (left.byteValue() / right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : int) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final int right) {", + " return (left.byteValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Integer) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Integer right) {", + " return (left.byteValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Byte left, final AtomicDouble right) {", + " return (left.byteValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : short) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final short right) {", + " return (left.byteValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Short) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Short right) {", + " return (left.byteValue() / right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Byte, right : AtomicInteger) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final AtomicInteger right) {", + " return (left.byteValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Byte, right : AtomicLong) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final AtomicLong right) {", + " return (left.byteValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final long right) {", + " return (left.byteValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final Long right) {", + " return (left.byteValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : byte) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final byte right) {", + " return (left.byteValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Byte) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Byte right) {", + " return (left.byteValue() * right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Byte left, final float right) {", + " return (left.byteValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Byte left, final Float right) {", + " return (left.byteValue() * right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : int) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final int right) {", + " return (left.byteValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Integer) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Integer right) {", + " return (left.byteValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Byte left, final AtomicDouble right) {", + " return (left.byteValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : short) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final short right) {", + " return (left.byteValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Short) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Short right) {", + " return (left.byteValue() * right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Byte, right : AtomicInteger) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final AtomicInteger right) {", + " return (left.byteValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Byte, right : AtomicLong) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final AtomicLong right) {", + " return (left.byteValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final long right) {", + " return (left.byteValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final Long right) {", + " return (left.byteValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Byte) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Byte right) {", + " return (left.byteValue() % right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : byte) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final byte right) {", + " return (left.byteValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Byte left, final float right) {", + " return (left.byteValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Byte left, final Float right) {", + " return (left.byteValue() % right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : int) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final int right) {", + " return (left.byteValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Integer) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Integer right) {", + " return (left.byteValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Byte left, final AtomicDouble right) {", + " return (left.byteValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : short) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final short right) {", + " return (left.byteValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Short) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Short right) {", + " return (left.byteValue() % right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Byte, right : AtomicInteger) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final AtomicInteger right) {", + " return (left.byteValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Byte, right : AtomicLong) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left, final AtomicLong right) {", + " return (left.byteValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/byteprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/byteprimitive/CodeTest.java new file mode 100644 index 0000000000..0c69810afa --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/byteprimitive/CodeTest.java @@ -0,0 +1,257 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.byteprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveByteArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveByteArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveByteArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveByteArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveByteArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveByteArithmeticExtensions.operator_power; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static byte left = 4; + + private static int right = 3; + + @Test + public void operator_minus_byte_Number() throws Exception { + assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_minus_byte_Long() throws Exception { + assertEquals(1, operator_minus(left, Long.valueOf(right))); + } + + @Test + public void operator_minus_byte_Byte() throws Exception { + assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); + } + + @Test + public void operator_minus_byte_Float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); + } + + @Test + public void operator_minus_byte_Integer() throws Exception { + assertEquals(1, operator_minus(left, Integer.valueOf(right))); + } + + @Test + public void operator_minus_byte_Short() throws Exception { + assertEquals(1, operator_minus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_minus_byte_AtomicInteger() throws Exception { + assertEquals(1, operator_minus(left, new AtomicInteger(right))); + } + + @Test + public void operator_minus_byte_AtomicLong() throws Exception { + assertEquals(1l, operator_minus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_byte_Long() throws Exception { + assertEquals(7l, operator_plus(left, Long.valueOf(right))); + } + + @Test + public void operator_plus_byte_Byte() throws Exception { + assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_plus_byte_Float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); + } + + @Test + public void operator_plus_byte_Integer() throws Exception { + assertEquals(7, operator_plus(left, Integer.valueOf(right))); + } + + @Test + public void operator_plus_byte_Short() throws Exception { + assertEquals(7, operator_plus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_plus_byte_AtomicInteger() throws Exception { + assertEquals(7, operator_plus(left, new AtomicInteger(right))); + } + + @Test + public void operator_plus_byte_AtomicLong() throws Exception { + assertEquals(7l, operator_plus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_byte_Number() throws Exception { + assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_byte_Number() throws Exception { + assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_divide_byte_Long() throws Exception { + assertEquals(1l, operator_divide(left, Long.valueOf(right))); + } + + @Test + public void operator_divide_byte_Byte() throws Exception { + assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_divide_byte_Float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); + } + + @Test + public void operator_divide_byte_Integer() throws Exception { + assertEquals(1, operator_divide(left, Integer.valueOf(right))); + } + + @Test + public void operator_divide_byte_Number() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_divide_byte_Short() throws Exception { + assertEquals(1, operator_divide(left, Short.valueOf((short) right))); + } + + @Test + public void operator_divide_byte_AtomicInteger() throws Exception { + assertEquals(1, operator_divide(left, new AtomicInteger(right))); + } + + @Test + public void operator_divide_byte_AtomicLong() throws Exception { + assertEquals(1l, operator_divide(left, new AtomicLong(right))); + } + + @Test + public void operator_multiply_byte_Long() throws Exception { + assertEquals(12l, operator_multiply(left, Long.valueOf(right))); + } + + @Test + public void operator_multiply_byte_Byte() throws Exception { + assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_multiply_byte_Float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); + } + + @Test + public void operator_multiply_byte_Integer() throws Exception { + assertEquals(12, operator_multiply(left, Integer.valueOf(right))); + } + + @Test + public void operator_multiply_byte_Number() throws Exception { + assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_multiply_byte_Short() throws Exception { + assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); + } + + @Test + public void operator_multiply_byte_AtomicInteger() throws Exception { + assertEquals(12, operator_multiply(left, new AtomicInteger(right))); + } + + @Test + public void operator_multiply_byte_AtomicLong() throws Exception { + assertEquals(12l, operator_multiply(left, new AtomicLong(right))); + } + + @Test + public void operator_modulo_byte_Long() throws Exception { + assertEquals(1l, operator_modulo(left, Long.valueOf(right))); + } + + @Test + public void operator_modulo_byte_Byte() throws Exception { + assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_modulo_byte_Float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); + } + + @Test + public void operator_modulo_byte_Integer() throws Exception { + assertEquals(1, operator_modulo(left, Integer.valueOf(right))); + } + + @Test + public void operator_modulo_byte_Number() throws Exception { + assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_modulo_byte_Short() throws Exception { + assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); + } + + @Test + public void operator_modulo_byte_AtomicInteger() throws Exception { + assertEquals(1, operator_modulo(left, new AtomicInteger(right))); + } + + @Test + public void operator_modulo_byte_AtomicLong() throws Exception { + assertEquals(1l, operator_modulo(left, new AtomicLong(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/byteprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/byteprimitive/CompilerTest.java new file mode 100644 index 0000000000..b55e491da1 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/byteprimitive/CompilerTest.java @@ -0,0 +1,1341 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.byteprimitive; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final byte left, final AtomicDouble right) {", + " return (left - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final byte left, final Long right) {", + " return (left - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Byte) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Byte right) {", + " return (left - right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final byte left, final Float right) {", + " return (left - right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Integer) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Integer right) {", + " return (left - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Short) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Short right) {", + " return (left - right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : byte, right : AtomicInteger) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final AtomicInteger right) {", + " return (left - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : byte, right : AtomicLong) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final byte left, final AtomicLong right) {", + " return (left - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final byte left, final Long right) {", + " return (left + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Byte) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Byte right) {", + " return (left + right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final byte left, final Float right) {", + " return (left + right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Integer) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Integer right) {", + " return (left + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Short) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Short right) {", + " return (left + right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : byte, right : AtomicInteger) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final AtomicInteger right) {", + " return (left + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final byte left, final Long right) {", + " return (left + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final byte left, final AtomicDouble right) {", + " return (left + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final byte left, final AtomicDouble right) {", + " return Math.pow(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final byte left, final Long right) {", + " return (left / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Byte) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Byte right) {", + " return (left / right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final byte left, final Float right) {", + " return (left / right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Integer) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Integer right) {", + " return (left / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final byte left, final AtomicDouble right) {", + " return (left / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Short) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Short right) {", + " return (left / right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : byte, right : AtomicInteger) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final AtomicInteger right) {", + " return (left / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : byte, right : AtomicLong) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final byte left, final AtomicLong right) {", + " return (left / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final byte left, final Long right) {", + " return (left * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Byte) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Byte right) {", + " return (left * right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final byte left, final Float right) {", + " return (left * right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Integer) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Integer right) {", + " return (left * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final byte left, final AtomicDouble right) {", + " return (left * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Short) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Short right) {", + " return (left * right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : byte, right : AtomicInteger) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final AtomicInteger right) {", + " return (left * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : byte, right : AtomicLong) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final byte left, final AtomicLong right) {", + " return (left * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final byte left, final Long right) {", + " return (left % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Byte) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Byte right) {", + " return (left % right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final byte left, final Float right) {", + " return (left % right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Integer) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Integer right) {", + " return (left % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final byte left, final AtomicDouble right) {", + " return (left % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Short) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Short right) {", + " return (left % right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : byte, right : AtomicInteger) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final AtomicInteger right) {", + " return (left % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : byte, right : AtomicLong) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final byte left, final AtomicLong right) {", + " return (left % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/doubleobject/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/doubleobject/CodeTest.java new file mode 100644 index 0000000000..41e5363804 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/doubleobject/CodeTest.java @@ -0,0 +1,209 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.doubleobject; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.DoubleArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.DoubleArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.DoubleArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.DoubleArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.DoubleArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.DoubleArithmeticExtensions.operator_power; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Double left = Double.valueOf(4); + + private static int right = 3; + + @Test + public void operator_minus_Double_long() throws Exception { + assertEpsilonEquals(1, operator_minus(left, (long) right)); + } + + @Test + public void operator_minus_Double_byte() throws Exception { + assertEpsilonEquals(1, operator_minus(left, (byte)right)); + } + + @Test + public void operator_minus_Double_float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, (float) right)); + } + + @Test + public void operator_minus_Double_int() throws Exception { + assertEpsilonEquals(1, operator_minus(left, (int) right)); + } + + @Test + public void operator_minus_Double_short() throws Exception { + assertEpsilonEquals(1, operator_minus(left, (short) right)); + } + + @Test + public void operator_plus_Double_long() throws Exception { + assertEpsilonEquals(7l, operator_plus(left, (long) right)); + } + + @Test + public void operator_plus_Double_byte() throws Exception { + assertEpsilonEquals(7, operator_plus(left, (byte) right)); + } + + @Test + public void operator_plus_Double_float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, (float) right)); + } + + @Test + public void operator_plus_Double_int() throws Exception { + assertEpsilonEquals(7, operator_plus(left, (int) right)); + } + + @Test + public void operator_plus_Double_short() throws Exception { + assertEpsilonEquals(7, operator_plus(left, (short) right)); + } + + @Test + public void operator_divide_Double_long() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (long) right)); + } + + @Test + public void operator_divide_Double_byte() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (byte) right)); + } + + @Test + public void operator_divide_Double_float() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (float) right)); + } + + @Test + public void operator_divide_Double_int() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (int) right)); + } + + @Test + public void operator_divide_Double_short() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (short) right)); + } + + @Test + public void operator_multiply_Double_long() throws Exception { + assertEpsilonEquals(12l, operator_multiply(left, (long) right)); + } + + @Test + public void operator_multiply_Double_byte() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, (byte) right)); + } + + @Test + public void operator_multiply_Double_float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, (float) right)); + } + + @Test + public void operator_multiply_Double_int() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, (int) right)); + } + + @Test + public void operator_multiply_Double_short() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, (short) right)); + } + + @Test + public void operator_modulo_Double_long() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, (long) right)); + } + + @Test + public void operator_modulo_Double_byte() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, (byte) right)); + } + + @Test + public void operator_modulo_Double_float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, (float) right)); + } + + @Test + public void operator_modulo_Double_int() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, (int) right)); + } + + @Test + public void operator_modulo_Double_short() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, (short) right)); + } + + @Test + public void operator_modulo_Double_Number() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_Double_byte() throws Exception { + assertEpsilonEquals(64., operator_power(left, (byte) right)); + } + + @Test + public void operator_power_Double_short() throws Exception { + assertEpsilonEquals(64., operator_power(left, (short) right)); + } + + @Test + public void operator_power_Double_int() throws Exception { + assertEpsilonEquals(64., operator_power(left, (int) right)); + } + + @Test + public void operator_power_Double_long() throws Exception { + assertEpsilonEquals(64., operator_power(left, (long) right)); + } + + @Test + public void operator_power_Double_float() throws Exception { + assertEpsilonEquals(64., operator_power(left, (float) right)); + } + + @Test + public void operator_power_Double_double() throws Exception { + assertEpsilonEquals(64., operator_power(left, (double) right)); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/doubleobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/doubleobject/CompilerTest.java new file mode 100644 index 0000000000..a2a9b5e598 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/doubleobject/CompilerTest.java @@ -0,0 +1,2368 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.doubleobject; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double) : double {", + " -left", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left) {", + " return DoubleExtensions.operator_minus(left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicDouble right) {", + " return DoubleExtensions.operator_minus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Double_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : long) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final long right) {", + " return (left.doubleValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Long) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Long right) {", + " return DoubleExtensions.operator_minus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Double_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : byte) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final byte right) {", + " return (left.doubleValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Byte) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Byte right) {", + " return DoubleExtensions.operator_minus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Double_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : float) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final float right) {", + " return (left.doubleValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Float) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Float right) {", + " return DoubleExtensions.operator_minus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Double_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : int) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final int right) {", + " return (left.doubleValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Integer) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Integer right) {", + " return DoubleExtensions.operator_minus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Double_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : short) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final short right) {", + " return (left.doubleValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Short) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Short right) {", + " return DoubleExtensions.operator_minus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Double, right : AtomicInteger) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicInteger right) {", + " return DoubleExtensions.operator_minus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Double, right : AtomicLong) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicLong right) {", + " return DoubleExtensions.operator_minus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Long) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Long right) {", + " return DoubleExtensions.operator_plus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Double_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : long) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final long right) {", + " return (left.doubleValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Double_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : byte) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final byte right) {", + " return (left.doubleValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Byte) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Byte right) {", + " return DoubleExtensions.operator_plus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Float) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Float right) {", + " return DoubleExtensions.operator_plus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Double_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : float) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final float right) {", + " return (left.doubleValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Integer) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Integer right) {", + " return DoubleExtensions.operator_plus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Double_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : int) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final int right) {", + " return (left.doubleValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Double_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : short) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final short right) {", + " return (left.doubleValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Short) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Short right) {", + " return DoubleExtensions.operator_plus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Double, right : AtomicInteger) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicInteger right) {", + " return DoubleExtensions.operator_plus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Long) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Long right) {", + " return DoubleExtensions.operator_plus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicDouble right) {", + " return DoubleExtensions.operator_plus(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicDouble right) {", + " return DoubleExtensions.operator_power(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Double_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : byte) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final byte right) {", + " return Math.pow(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Double_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : short) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final short right) {", + " return Math.pow(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Double_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : int) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final int right) {", + " return Math.pow(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Double_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : long) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final long right) {", + " return Math.pow(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Double_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : float) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final float right) {", + " return Math.pow(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Double_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : double) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final double right) {", + " return Math.pow(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Double_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : long) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final long right) {", + " return (left.doubleValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Long) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Long right) {", + " return DoubleExtensions.operator_divide(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Double_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : byte) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final byte right) {", + " return (left.doubleValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Byte) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Byte right) {", + " return DoubleExtensions.operator_divide(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Double_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : float) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final float right) {", + " return (left.doubleValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Float) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Float right) {", + " return DoubleExtensions.operator_divide(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Double_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : int) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final int right) {", + " return (left.doubleValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Integer) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Integer right) {", + " return DoubleExtensions.operator_divide(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicDouble right) {", + " return DoubleExtensions.operator_divide(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Double_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : short) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final short right) {", + " return (left.doubleValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Short) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Short right) {", + " return DoubleExtensions.operator_divide(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Double, right : AtomicInteger) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicInteger right) {", + " return DoubleExtensions.operator_divide(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Double, right : AtomicLong) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicLong right) {", + " return DoubleExtensions.operator_divide(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Double_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : long) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final long right) {", + " return (left.doubleValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Long) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Long right) {", + " return DoubleExtensions.operator_multiply(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Double_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : byte) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final byte right) {", + " return (left.doubleValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Byte) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Byte right) {", + " return DoubleExtensions.operator_multiply(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Double_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : float) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final float right) {", + " return (left.doubleValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Float) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Float right) {", + " return DoubleExtensions.operator_multiply(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Double_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : int) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final int right) {", + " return (left.doubleValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Integer) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Integer right) {", + " return DoubleExtensions.operator_multiply(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicDouble right) {", + " return DoubleExtensions.operator_multiply(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Double_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : short) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final short right) {", + " return (left.doubleValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Short) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Short right) {", + " return DoubleExtensions.operator_multiply(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Double, right : AtomicInteger) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicInteger right) {", + " return DoubleExtensions.operator_multiply(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Double, right : AtomicLong) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.DoubleExtensions;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicLong right) {", + " return DoubleExtensions.operator_multiply(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Double_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : long) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final long right) {", + " return (left.doubleValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Long) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Long right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Byte) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Byte right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Double_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : byte) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final byte right) {", + " return (left.doubleValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Double_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : float) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final float right) {", + " return (left.doubleValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Float) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Float right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Double_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : int) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final int right) {", + " return (left.doubleValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Integer) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Integer right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicDouble right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Double_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : short) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final short right) {", + " return (left.doubleValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Short) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final Short right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Double, right : AtomicInteger) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicInteger right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Double, right : AtomicLong) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left, final AtomicLong right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/doubleprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/doubleprimitive/CodeTest.java new file mode 100644 index 0000000000..c652180016 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/doubleprimitive/CodeTest.java @@ -0,0 +1,79 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.doubleprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveDoubleArithmeticExtensions.operator_power; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static double left = 4.; + + private static int right = 3; + + @Test + public void operator_minus_double_Number() { + assertEpsilonEquals(1., operator_minus(left, Double.valueOf(right))); + } + + @Test + public void operator_plus_double_Number() { + assertEpsilonEquals(7., operator_plus(left, Double.valueOf(right))); + } + + @Test + public void operator_power_double_Number() { + assertEpsilonEquals(64., operator_power(left, Double.valueOf(right))); + } + + @Test + public void operator_divide_double_Number() { + assertEpsilonEquals(1.33333333333333333333, operator_divide(left, Double.valueOf(right))); + } + + @Test + public void operator_multiply_double_Number() { + assertEpsilonEquals(12., operator_multiply(left, Double.valueOf(right))); + } + + @Test + public void operator_modulo_double_Number() { + assertEpsilonEquals(1., operator_modulo(left, Double.valueOf(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/doubleprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/doubleprimitive/CompilerTest.java new file mode 100644 index 0000000000..df95204a35 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/doubleprimitive/CompilerTest.java @@ -0,0 +1,1341 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.doubleprimitive; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicDouble right) {", + " return (left - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Long) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Long right) {", + " return (left - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Byte) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Byte right) {", + " return (left - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Float) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Float right) {", + " return (left - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Integer) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Integer right) {", + " return (left - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Short) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Short right) {", + " return (left - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : double, right : AtomicInteger) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicInteger right) {", + " return (left - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : double, right : AtomicLong): double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicLong right) {", + " return (left - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Long): double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Long right) {", + " return (left + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Byte): double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Byte right) {", + " return (left + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Float) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Float right) {", + " return (left + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Integer): double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Integer right) {", + " return (left + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Short): double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Short right) {", + " return (left + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : double, right : AtomicInteger): double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicInteger right) {", + " return (left + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Long): double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Long right) {", + " return (left + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicDouble right) {", + " return (left + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicDouble right) {", + " return Math.pow(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Long): double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Long right) {", + " return (left / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Byte): double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Byte right) {", + " return (left / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Float) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Float right) {", + " return (left / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Integer): double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Integer right) {", + " return (left / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicDouble right) {", + " return (left / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Short): double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Short right) {", + " return (left / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : double, right : AtomicInteger): double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicInteger right) {", + " return (left / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : double, right : AtomicLong): double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicLong right) {", + " return (left / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Long): double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Long right) {", + " return (left * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Byte): double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Byte right) {", + " return (left * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Float) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Float right) {", + " return (left * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Integer): double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Integer right) {", + " return (left * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicDouble right) {", + " return (left * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Short): double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Short right) {", + " return (left * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : double, right : AtomicInteger): double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicInteger right) {", + " return (left * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : double, right : AtomicLong): double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicLong right) {", + " return (left * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Long): double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Long right) {", + " return (left % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Byte): double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Byte right) {", + " return (left % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Float) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Float right) {", + " return (left % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Integer): double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Integer right) {", + " return (left % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicDouble right) {", + " return (left % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Short): double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final Short right) {", + " return (left % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : double, right : AtomicInteger): double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicInteger right) {", + " return (left % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : double, right : AtomicLong): double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left, final AtomicLong right) {", + " return (left % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/floatobject/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/floatobject/CodeTest.java new file mode 100644 index 0000000000..a2f7a62e34 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/floatobject/CodeTest.java @@ -0,0 +1,417 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.floatobject; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.FloatArithmeticExtensions.operator_power; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Float left = Float.valueOf(4); + + private static int right = 3; + + @Test + public void operator_minus_Float() throws Exception { + assertEpsilonEquals(-4, operator_minus(left)); + } + + @Test + public void operator_minus_Float_Number() throws Exception { + assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_minus_Float_long() throws Exception { + assertEpsilonEquals(1, operator_minus(left, (long) right)); + } + + @Test + public void operator_minus_Float_Long() throws Exception { + assertEpsilonEquals(1, operator_minus(left, Long.valueOf(right))); + } + + @Test + public void operator_minus_Float_byte() throws Exception { + assertEpsilonEquals(1, operator_minus(left, (byte)right)); + } + + @Test + public void operator_minus_Float_Byte() throws Exception { + assertEpsilonEquals(1, operator_minus(left, Byte.valueOf((byte)right))); + } + + @Test + public void operator_minus_Float_float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, (float) right)); + } + + @Test + public void operator_minus_Float_Float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); + } + + @Test + public void operator_minus_Float_int() throws Exception { + assertEpsilonEquals(1, operator_minus(left, (int) right)); + } + + @Test + public void operator_minus_Float_Integer() throws Exception { + assertEpsilonEquals(1, operator_minus(left, Integer.valueOf(right))); + } + + @Test + public void operator_minus_Float_short() throws Exception { + assertEpsilonEquals(1, operator_minus(left, (short) right)); + } + + @Test + public void operator_minus_Float_Short() throws Exception { + assertEpsilonEquals(1, operator_minus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_minus_Float_AtomicInteger() throws Exception { + assertEpsilonEquals(1, operator_minus(left, new AtomicInteger(right))); + } + + @Test + public void operator_minus_Float_AtomicLong() throws Exception { + assertEpsilonEquals(1l, operator_minus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_Float_long() throws Exception { + assertEpsilonEquals(7l, operator_plus(left, (long) right)); + } + + @Test + public void operator_plus_Float_Long() throws Exception { + assertEpsilonEquals(7l, operator_plus(left, Long.valueOf(right))); + } + + @Test + public void operator_plus_Float_byte() throws Exception { + assertEpsilonEquals(7, operator_plus(left, (byte) right)); + } + + @Test + public void operator_plus_Float_Byte() throws Exception { + assertEpsilonEquals(7, operator_plus(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_plus_Float_float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, (float) right)); + } + + @Test + public void operator_plus_Float_Float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); + } + + @Test + public void operator_plus_Float_int() throws Exception { + assertEpsilonEquals(7, operator_plus(left, (int) right)); + } + + @Test + public void operator_plus_Float_Integer() throws Exception { + assertEpsilonEquals(7, operator_plus(left, Integer.valueOf(right))); + } + + @Test + public void operator_plus_Float_short() throws Exception { + assertEpsilonEquals(7, operator_plus(left, (short) right)); + } + + @Test + public void operator_plus_Float_Short() throws Exception { + assertEpsilonEquals(7, operator_plus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_plus_Float_AtomicInteger() throws Exception { + assertEpsilonEquals(7, operator_plus(left, new AtomicInteger(right))); + } + + @Test + public void operator_plus_Float_AtomicLong() throws Exception { + assertEpsilonEquals(7l, operator_plus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_Float_Number() throws Exception { + assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_Float_Number() throws Exception { + assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_power_Float_byte() throws Exception { + assertEpsilonEquals(64., operator_power(left, (byte) right)); + } + + @Test + public void operator_power_Float_short() throws Exception { + assertEpsilonEquals(64., operator_power(left, (short) right)); + } + + @Test + public void operator_power_Float_int() throws Exception { + assertEpsilonEquals(64., operator_power(left, (int) right)); + } + + @Test + public void operator_power_Float_long() throws Exception { + assertEpsilonEquals(64., operator_power(left, (long) right)); + } + + @Test + public void operator_power_Float_float() throws Exception { + assertEpsilonEquals(64., operator_power(left, (float) right)); + } + + @Test + public void operator_power_Float_double() throws Exception { + assertEpsilonEquals(64., operator_power(left, (double) right)); + } + + @Test + public void operator_divide_Float_long() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (long) right)); + } + + @Test + public void operator_divide_Float_Long() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Long.valueOf(right))); + } + + @Test + public void operator_divide_Float_byte() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (byte) right)); + } + + @Test + public void operator_divide_Float_Byte() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_divide_Float_float() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (float) right)); + } + + @Test + public void operator_divide_Float_Float() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Float.valueOf(right))); + } + + @Test + public void operator_divide_Float_int() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (int) right)); + } + + @Test + public void operator_divide_Float_Integer() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Integer.valueOf(right))); + } + + @Test + public void operator_divide_Float_Number() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_divide_Float_short() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (short) right)); + } + + @Test + public void operator_divide_Float_Short() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Short.valueOf((short) right))); + } + + @Test + public void operator_divide_Float_AtomicInteger() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, new AtomicInteger(right))); + } + + @Test + public void operator_divide_Float_AtomicLong() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, new AtomicLong(right))); + } + + @Test + public void operator_multiply_Float_long() throws Exception { + assertEpsilonEquals(12l, operator_multiply(left, (long) right)); + } + + @Test + public void operator_multiply_Float_Long() throws Exception { + assertEpsilonEquals(12l, operator_multiply(left, Long.valueOf(right))); + } + + @Test + public void operator_multiply_Float_byte() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, (byte) right)); + } + + @Test + public void operator_multiply_Float_Byte() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_multiply_Float_float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, (float) right)); + } + + @Test + public void operator_multiply_Float_Float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); + } + + @Test + public void operator_multiply_Float_int() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, (int) right)); + } + + @Test + public void operator_multiply_Float_Integer() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, Integer.valueOf(right))); + } + + @Test + public void operator_multiply_Float_Number() throws Exception { + assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_multiply_Float_short() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, (short) right)); + } + + @Test + public void operator_multiply_Float_Short() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, Short.valueOf((short) right))); + } + + @Test + public void operator_multiply_Float_AtomicInteger() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, new AtomicInteger(right))); + } + + @Test + public void operator_multiply_Float_AtomicLong() throws Exception { + assertEpsilonEquals(12l, operator_multiply(left, new AtomicLong(right))); + } + + @Test + public void operator_modulo_Float_long() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, (long) right)); + } + + @Test + public void operator_modulo_Float_Long() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, Long.valueOf(right))); + } + + @Test + public void operator_modulo_Float_byte() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, (byte) right)); + } + + @Test + public void operator_modulo_Float_Byte() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_modulo_Float_float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, (float) right)); + } + + @Test + public void operator_modulo_Float_Float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); + } + + @Test + public void operator_modulo_Float_int() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, (int) right)); + } + + @Test + public void operator_modulo_Float_Integer() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, Integer.valueOf(right))); + } + + @Test + public void operator_modulo_Float_Number() throws Exception { + assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_modulo_Float_short() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, (short) right)); + } + + @Test + public void operator_modulo_Float_Short() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, Short.valueOf((short) right))); + } + + @Test + public void operator_modulo_Float_AtomicInteger() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, new AtomicInteger(right))); + } + + @Test + public void operator_modulo_Float_AtomicLong() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, new AtomicLong(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/floatobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/floatobject/CompilerTest.java new file mode 100644 index 0000000000..8801fea9ef --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/floatobject/CompilerTest.java @@ -0,0 +1,2334 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.floatobject; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float) : float {", + " -left", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left) {", + " return (-(left.floatValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Float_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Float left, final AtomicDouble right) {", + " return (left.floatValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Float_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : long) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final long right) {", + " return (left.floatValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Float_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Long) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Long right) {", + " return (left.floatValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Float_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : byte) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final byte right) {", + " return (left.floatValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Float_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Byte) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Byte right) {", + " return (left.floatValue() - right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Float_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final float right) {", + " return (left.floatValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Float_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Float right) {", + " return (left.floatValue() - right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Float_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : int) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final int right) {", + " return (left.floatValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Float_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Integer) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Integer right) {", + " return (left.floatValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Float_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : short) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final short right) {", + " return (left.floatValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Float_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Short) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Short right) {", + " return (left.floatValue() - right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Float_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Float, right : AtomicInteger) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final AtomicInteger right) {", + " return (left.floatValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Float_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Float, right : AtomicLong) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final AtomicLong right) {", + " return (left.floatValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Float_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Long) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Long right) {", + " return (left.floatValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Float_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : long) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final long right) {", + " return (left.floatValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Float_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : byte) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final byte right) {", + " return (left.floatValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Float_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Byte) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Byte right) {", + " return (left.floatValue() + right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Float_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Float right) {", + " return (left.floatValue() + right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Float_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final float right) {", + " return (left.floatValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Float_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Integer) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Integer right) {", + " return (left.floatValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Float_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : int) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final int right) {", + " return (left.floatValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Float_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : short) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final short right) {", + " return (left.floatValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Float_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Short) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Short right) {", + " return (left.floatValue() + right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Float_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Float, right : AtomicInteger) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final AtomicInteger right) {", + " return (left.floatValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Float_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Long) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Long right) {", + " return (left.floatValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Float_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Float left, final AtomicDouble right) {", + " return (left.floatValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Float_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Float left, final AtomicDouble right) {", + " return Math.pow(left.floatValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Float_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : byte) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Float left, final byte right) {", + " return Math.pow(left.floatValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Float_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : short) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Float left, final short right) {", + " return Math.pow(left.floatValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Float_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : int) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Float left, final int right) {", + " return Math.pow(left.floatValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Float_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : long) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Float left, final long right) {", + " return Math.pow(left.floatValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Float_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : float) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Float left, final float right) {", + " return Math.pow(left.floatValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Float_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : double) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Float left, final double right) {", + " return Math.pow(left.floatValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Float_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : long) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final long right) {", + " return (left.floatValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Float_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Long) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Long right) {", + " return (left.floatValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Float_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : byte) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final byte right) {", + " return (left.floatValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Float_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Byte) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Byte right) {", + " return (left.floatValue() / right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Float_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final float right) {", + " return (left.floatValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Float_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Float right) {", + " return (left.floatValue() / right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Float_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : int) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final int right) {", + " return (left.floatValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Float_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Integer) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Integer right) {", + " return (left.floatValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Float_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Float left, final AtomicDouble right) {", + " return (left.floatValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Float_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : short) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final short right) {", + " return (left.floatValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Float_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Short) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Short right) {", + " return (left.floatValue() / right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Float_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Float, right : AtomicInteger) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final AtomicInteger right) {", + " return (left.floatValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Float_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Float, right : AtomicLong) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final AtomicLong right) {", + " return (left.floatValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Float_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : long) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final long right) {", + " return (left.floatValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Float_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Long) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Long right) {", + " return (left.floatValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Float_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : byte) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final byte right) {", + " return (left.floatValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Float_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Byte) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Byte right) {", + " return (left.floatValue() * right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Float_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final float right) {", + " return (left.floatValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Float_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Float right) {", + " return (left.floatValue() * right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Float_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : int) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final int right) {", + " return (left.floatValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Float_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Integer) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Integer right) {", + " return (left.floatValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Float_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Float left, final AtomicDouble right) {", + " return (left.floatValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Float_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : short) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final short right) {", + " return (left.floatValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Float_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Short) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Short right) {", + " return (left.floatValue() * right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Float_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Float, right : AtomicInteger) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final AtomicInteger right) {", + " return (left.floatValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Float_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Float, right : AtomicLong) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final AtomicLong right) {", + " return (left.floatValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Float_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : long) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final long right) {", + " return (left.floatValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Float_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Long) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Long right) {", + " return (left.floatValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Float_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Byte) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Byte right) {", + " return (left.floatValue() % right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Float_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : byte) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final byte right) {", + " return (left.floatValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Float_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final float right) {", + " return (left.floatValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Float_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Float right) {", + " return (left.floatValue() % right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Float_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : int) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final int right) {", + " return (left.floatValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Float_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Integer) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Integer right) {", + " return (left.floatValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Float_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Float left, final AtomicDouble right) {", + " return (left.floatValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Float_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : short) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final short right) {", + " return (left.floatValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Float_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Short) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final Short right) {", + " return (left.floatValue() % right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Float_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Float, right : AtomicInteger) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final AtomicInteger right) {", + " return (left.floatValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Float_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Float, right : AtomicLong) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left, final AtomicLong right) {", + " return (left.floatValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/floatprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/floatprimitive/CodeTest.java new file mode 100644 index 0000000000..de2e86b0fc --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/floatprimitive/CodeTest.java @@ -0,0 +1,257 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.floatprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveFloatArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveFloatArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveFloatArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveFloatArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveFloatArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveFloatArithmeticExtensions.operator_power; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static float left = 4f; + + private static int right = 3; + + @Test + public void operator_minus_float_Number() throws Exception { + assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_minus_float_Long() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Long.valueOf(right))); + } + + @Test + public void operator_minus_float_Byte() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Byte.valueOf((byte)right))); + } + + @Test + public void operator_minus_float_Float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); + } + + @Test + public void operator_minus_float_Integer() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Integer.valueOf(right))); + } + + @Test + public void operator_minus_float_Short() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_minus_float_AtomicInteger() throws Exception { + assertEpsilonEquals(1, operator_minus(left, new AtomicInteger(right))); + } + + @Test + public void operator_minus_float_AtomicLong() throws Exception { + assertEpsilonEquals(1l, operator_minus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_float_Long() throws Exception { + assertEpsilonEquals(7l, operator_plus(left, Long.valueOf(right))); + } + + @Test + public void operator_plus_float_Byte() throws Exception { + assertEpsilonEquals(7, operator_plus(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_plus_float_Float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); + } + + @Test + public void operator_plus_float_Integer() throws Exception { + assertEpsilonEquals(7, operator_plus(left, Integer.valueOf(right))); + } + + @Test + public void operator_plus_float_Short() throws Exception { + assertEpsilonEquals(7, operator_plus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_plus_float_AtomicInteger() throws Exception { + assertEpsilonEquals(7, operator_plus(left, new AtomicInteger(right))); + } + + @Test + public void operator_plus_float_AtomicLong() throws Exception { + assertEpsilonEquals(7l, operator_plus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_float_Number() throws Exception { + assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_float_Number() throws Exception { + assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_divide_float_Long() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, Long.valueOf(right))); + } + + @Test + public void operator_divide_float_Byte() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_divide_float_Float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); + } + + @Test + public void operator_divide_float_Integer() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, Integer.valueOf(right))); + } + + @Test + public void operator_divide_float_Number() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_divide_float_Short() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, Short.valueOf((short) right))); + } + + @Test + public void operator_divide_float_AtomicInteger() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, new AtomicInteger(right))); + } + + @Test + public void operator_divide_float_AtomicLong() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, new AtomicLong(right))); + } + + @Test + public void operator_multiply_float_Long() throws Exception { + assertEpsilonEquals(12l, operator_multiply(left, Long.valueOf(right))); + } + + @Test + public void operator_multiply_float_Byte() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_multiply_float_Float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); + } + + @Test + public void operator_multiply_float_Integer() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, Integer.valueOf(right))); + } + + @Test + public void operator_multiply_float_Number() throws Exception { + assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_multiply_float_Short() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, Short.valueOf((short) right))); + } + + @Test + public void operator_multiply_float_AtomicInteger() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, new AtomicInteger(right))); + } + + @Test + public void operator_multiply_float_AtomicLong() throws Exception { + assertEpsilonEquals(12l, operator_multiply(left, new AtomicLong(right))); + } + + @Test + public void operator_modulo_float_Long() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, Long.valueOf(right))); + } + + @Test + public void operator_modulo_float_Byte() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_modulo_float_Float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); + } + + @Test + public void operator_modulo_float_Integer() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, Integer.valueOf(right))); + } + + @Test + public void operator_modulo_float_Number() throws Exception { + assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_modulo_float_Short() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, Short.valueOf((short) right))); + } + + @Test + public void operator_modulo_float_AtomicInteger() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, new AtomicInteger(right))); + } + + @Test + public void operator_modulo_float_AtomicLong() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, new AtomicLong(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/floatprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/floatprimitive/CompilerTest.java new file mode 100644 index 0000000000..f18aab05ef --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/floatprimitive/CompilerTest.java @@ -0,0 +1,1341 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.floatprimitive; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_float_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final float left, final AtomicDouble right) {", + " return (left - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_float_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Long) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Long right) {", + " return (left - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_float_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Byte) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Byte right) {", + " return (left - right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_float_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Float right) {", + " return (left - right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_float_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Integer) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Integer right) {", + " return (left - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_float_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Short) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Short right) {", + " return (left - right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_float_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : float, right : AtomicInteger) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final AtomicInteger right) {", + " return (left - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_float_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : float, right : AtomicLong): float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final AtomicLong right) {", + " return (left - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_float_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Long): float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Long right) {", + " return (left + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_float_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Byte): float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Byte right) {", + " return (left + right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_float_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Float right) {", + " return (left + right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_float_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Integer): float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Integer right) {", + " return (left + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_float_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Short): float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Short right) {", + " return (left + right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_float_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : float, right : AtomicInteger): float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final AtomicInteger right) {", + " return (left + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_float_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Long): float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Long right) {", + " return (left + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_float_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final float left, final AtomicDouble right) {", + " return (left + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_float_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final float left, final AtomicDouble right) {", + " return Math.pow(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_float_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Long): float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Long right) {", + " return (left / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_float_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Byte): float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Byte right) {", + " return (left / right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_float_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Float right) {", + " return (left / right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_float_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Integer): float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Integer right) {", + " return (left / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_float_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final float left, final AtomicDouble right) {", + " return (left / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_float_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Short): float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Short right) {", + " return (left / right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_float_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : float, right : AtomicInteger): float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final AtomicInteger right) {", + " return (left / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_float_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : float, right : AtomicLong): float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final AtomicLong right) {", + " return (left / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_float_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Long): float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Long right) {", + " return (left * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_float_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Byte): float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Byte right) {", + " return (left * right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_float_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Float right) {", + " return (left * right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_float_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Integer): float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Integer right) {", + " return (left * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_float_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final float left, final AtomicDouble right) {", + " return (left * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_float_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Short): float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Short right) {", + " return (left * right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_float_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : float, right : AtomicInteger): float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final AtomicInteger right) {", + " return (left * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_float_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : float, right : AtomicLong): float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final AtomicLong right) {", + " return (left * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_float_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Long): float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Long right) {", + " return (left % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_float_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Byte): float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Byte right) {", + " return (left % right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_float_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Float right) {", + " return (left % right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_float_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Integer): float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Integer right) {", + " return (left % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_float_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final float left, final AtomicDouble right) {", + " return (left % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_float_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Short): float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final Short right) {", + " return (left % right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_float_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : float, right : AtomicInteger): float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final AtomicInteger right) {", + " return (left % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_float_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : float, right : AtomicLong): float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left, final AtomicLong right) {", + " return (left % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/integerobject/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/integerobject/CodeTest.java new file mode 100644 index 0000000000..ce137fdb8b --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/integerobject/CodeTest.java @@ -0,0 +1,418 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.integerobject; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.IntegerArithmeticExtensions.operator_power; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Integer left = 4; + + private static int right = 3; + + @Test + public void operator_minus_Integer() throws Exception { + assertEquals(-4, operator_minus(left)); + } + + @Test + public void operator_minus_Integer_Number() throws Exception { + assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_minus_Integer_long() throws Exception { + assertEquals(1, operator_minus(left, (long) right)); + } + + @Test + public void operator_minus_Integer_Long() throws Exception { + assertEquals(1, operator_minus(left, Long.valueOf(right))); + } + + @Test + public void operator_minus_Integer_byte() throws Exception { + assertEquals(1, operator_minus(left, (byte)right)); + } + + @Test + public void operator_minus_Integer_Byte() throws Exception { + assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); + } + + @Test + public void operator_minus_Integer_float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, (float) right)); + } + + @Test + public void operator_minus_Integer_Float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); + } + + @Test + public void operator_minus_Integer_int() throws Exception { + assertEquals(1, operator_minus(left, (int) right)); + } + + @Test + public void operator_minus_Integer_Integer() throws Exception { + assertEquals(1, operator_minus(left, Integer.valueOf(right))); + } + + @Test + public void operator_minus_Integer_short() throws Exception { + assertEquals(1, operator_minus(left, (short) right)); + } + + @Test + public void operator_minus_Integer_Short() throws Exception { + assertEquals(1, operator_minus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_minus_Integer_AtomicInteger() throws Exception { + assertEquals(1, operator_minus(left, new AtomicInteger(right))); + } + + @Test + public void operator_minus_Integer_AtomicLong() throws Exception { + assertEquals(1l, operator_minus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_Integer_long() throws Exception { + assertEquals(7l, operator_plus(left, (long) right)); + } + + @Test + public void operator_plus_Integer_Long() throws Exception { + assertEquals(7l, operator_plus(left, Long.valueOf(right))); + } + + @Test + public void operator_plus_Integer_byte() throws Exception { + assertEquals(7, operator_plus(left, (byte) right)); + } + + @Test + public void operator_plus_Integer_Byte() throws Exception { + assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_plus_Integer_float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, (float) right)); + } + + @Test + public void operator_plus_Integer_Float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); + } + + @Test + public void operator_plus_Integer_int() throws Exception { + assertEquals(7, operator_plus(left, (int) right)); + } + + @Test + public void operator_plus_Integer_Integer() throws Exception { + assertEquals(7, operator_plus(left, Integer.valueOf(right))); + } + + @Test + public void operator_plus_Integer_short() throws Exception { + assertEquals(7, operator_plus(left, (short) right)); + } + + @Test + public void operator_plus_Integer_Short() throws Exception { + assertEquals(7, operator_plus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_plus_Integer_AtomicInteger() throws Exception { + assertEquals(7, operator_plus(left, new AtomicInteger(right))); + } + + @Test + public void operator_plus_Integer_AtomicLong() throws Exception { + assertEquals(7l, operator_plus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_Integer_Number() throws Exception { + assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_Integer_Number() throws Exception { + assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); + } + + + @Test + public void operator_power_Integer_byte() throws Exception { + assertEpsilonEquals(64., operator_power(left, (byte) right)); + } + + @Test + public void operator_power_Integer_short() throws Exception { + assertEpsilonEquals(64., operator_power(left, (short) right)); + } + + @Test + public void operator_power_Integer_int() throws Exception { + assertEpsilonEquals(64., operator_power(left, (int) right)); + } + + @Test + public void operator_power_Integer_long() throws Exception { + assertEpsilonEquals(64., operator_power(left, (long) right)); + } + + @Test + public void operator_power_Integer_float() throws Exception { + assertEpsilonEquals(64., operator_power(left, (float) right)); + } + + @Test + public void operator_power_Integer_double() throws Exception { + assertEpsilonEquals(64., operator_power(left, (double) right)); + } + + @Test + public void operator_divide_Integer_long() throws Exception { + assertEquals(1l, operator_divide(left, (long) right)); + } + + @Test + public void operator_divide_Integer_Long() throws Exception { + assertEquals(1l, operator_divide(left, Long.valueOf(right))); + } + + @Test + public void operator_divide_Integer_byte() throws Exception { + assertEquals(1l, operator_divide(left, (byte) right)); + } + + @Test + public void operator_divide_Integer_Byte() throws Exception { + assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_divide_Integer_float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, (float) right)); + } + + @Test + public void operator_divide_Integer_Float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); + } + + @Test + public void operator_divide_Integer_int() throws Exception { + assertEquals(1, operator_divide(left, (int) right)); + } + + @Test + public void operator_divide_Integer_Integer() throws Exception { + assertEquals(1, operator_divide(left, Integer.valueOf(right))); + } + + @Test + public void operator_divide_Integer_Number() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_divide_Integer_short() throws Exception { + assertEquals(1, operator_divide(left, (short) right)); + } + + @Test + public void operator_divide_Integer_Short() throws Exception { + assertEquals(1, operator_divide(left, Short.valueOf((short) right))); + } + + @Test + public void operator_divide_Integer_AtomicInteger() throws Exception { + assertEquals(1, operator_divide(left, new AtomicInteger(right))); + } + + @Test + public void operator_divide_Integer_AtomicLong() throws Exception { + assertEquals(1l, operator_divide(left, new AtomicLong(right))); + } + + @Test + public void operator_multiply_Integer_long() throws Exception { + assertEquals(12l, operator_multiply(left, (long) right)); + } + + @Test + public void operator_multiply_Integer_Long() throws Exception { + assertEquals(12l, operator_multiply(left, Long.valueOf(right))); + } + + @Test + public void operator_multiply_Integer_byte() throws Exception { + assertEquals(12, operator_multiply(left, (byte) right)); + } + + @Test + public void operator_multiply_Integer_Byte() throws Exception { + assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_multiply_Integer_float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, (float) right)); + } + + @Test + public void operator_multiply_Integer_Float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); + } + + @Test + public void operator_multiply_Integer_int() throws Exception { + assertEquals(12, operator_multiply(left, (int) right)); + } + + @Test + public void operator_multiply_Integer_Integer() throws Exception { + assertEquals(12, operator_multiply(left, Integer.valueOf(right))); + } + + @Test + public void operator_multiply_Integer_Number() throws Exception { + assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_multiply_Integer_short() throws Exception { + assertEquals(12, operator_multiply(left, (short) right)); + } + + @Test + public void operator_multiply_Integer_Short() throws Exception { + assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); + } + + @Test + public void operator_multiply_Integer_AtomicInteger() throws Exception { + assertEquals(12, operator_multiply(left, new AtomicInteger(right))); + } + + @Test + public void operator_multiply_Integer_AtomicLong() throws Exception { + assertEquals(12l, operator_multiply(left, new AtomicLong(right))); + } + + @Test + public void operator_modulo_Integer_long() throws Exception { + assertEquals(1l, operator_modulo(left, (long) right)); + } + + @Test + public void operator_modulo_Integer_Long() throws Exception { + assertEquals(1l, operator_modulo(left, Long.valueOf(right))); + } + + @Test + public void operator_modulo_Integer_byte() throws Exception { + assertEquals(1l, operator_modulo(left, (byte) right)); + } + + @Test + public void operator_modulo_Integer_Byte() throws Exception { + assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_modulo_Integer_float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, (float) right)); + } + + @Test + public void operator_modulo_Integer_Float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); + } + + @Test + public void operator_modulo_Integer_int() throws Exception { + assertEquals(1, operator_modulo(left, (int) right)); + } + + @Test + public void operator_modulo_Integer_Integer() throws Exception { + assertEquals(1, operator_modulo(left, Integer.valueOf(right))); + } + + @Test + public void operator_modulo_Integer_Number() throws Exception { + assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_modulo_Integer_short() throws Exception { + assertEquals(1, operator_modulo(left, (short) right)); + } + + @Test + public void operator_modulo_Integer_Short() throws Exception { + assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); + } + + @Test + public void operator_modulo_Integer_AtomicInteger() throws Exception { + assertEquals(1, operator_modulo(left, new AtomicInteger(right))); + } + + @Test + public void operator_modulo_Integer_AtomicLong() throws Exception { + assertEquals(1l, operator_modulo(left, new AtomicLong(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/integerobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/integerobject/CompilerTest.java new file mode 100644 index 0000000000..fbee566777 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/integerobject/CompilerTest.java @@ -0,0 +1,2334 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.integerobject; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer) : int {", + " -left", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left) {", + " return (-(left.intValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Integer_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Integer left, final AtomicDouble right) {", + " return (left.intValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Integer_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final long right) {", + " return (left.intValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Integer_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final Long right) {", + " return (left.intValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Integer_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : byte) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final byte right) {", + " return (left.intValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Integer_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Byte) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Byte right) {", + " return (left.intValue() - right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Integer_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Integer left, final float right) {", + " return (left.intValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Integer_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Integer left, final Float right) {", + " return (left.intValue() - right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Integer_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : int) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final int right) {", + " return (left.intValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Integer_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Integer) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Integer right) {", + " return (left.intValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Integer_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : short) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final short right) {", + " return (left.intValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Integer_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Short) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Short right) {", + " return (left.intValue() - right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Integer_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Integer, right : AtomicInteger) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final AtomicInteger right) {", + " return (left.intValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Integer_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Integer, right : AtomicLong) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final AtomicLong right) {", + " return (left.intValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Integer_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final Long right) {", + " return (left.intValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Integer_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final long right) {", + " return (left.intValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Integer_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : byte) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final byte right) {", + " return (left.intValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Integer_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Byte) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Byte right) {", + " return (left.intValue() + right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Integer_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Integer left, final Float right) {", + " return (left.intValue() + right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Integer_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Integer left, final float right) {", + " return (left.intValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Integer_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Integer) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Integer right) {", + " return (left.intValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Integer_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : int) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final int right) {", + " return (left.intValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Integer_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : short) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final short right) {", + " return (left.intValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Integer_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Short) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Short right) {", + " return (left.intValue() + right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Integer_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Integer, right : AtomicInteger) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final AtomicInteger right) {", + " return (left.intValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Integer_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final Long right) {", + " return (left.intValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Integer_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Integer left, final AtomicDouble right) {", + " return (left.intValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Integer_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Integer left, final AtomicDouble right) {", + " return Math.pow(left.intValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Integer_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : byte) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Integer left, final byte right) {", + " return Math.pow(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Integer_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : short) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Integer left, final short right) {", + " return Math.pow(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Integer_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : int) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Integer left, final int right) {", + " return Math.pow(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Integer_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : long) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Integer left, final long right) {", + " return Math.pow(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Integer_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : float) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Integer left, final float right) {", + " return Math.pow(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Integer_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : double) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Integer left, final double right) {", + " return Math.pow(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Integer_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final long right) {", + " return (left.intValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Integer_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final Long right) {", + " return (left.intValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Integer_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : byte) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final byte right) {", + " return (left.intValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Integer_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Byte) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Byte right) {", + " return (left.intValue() / right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Integer_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Integer left, final float right) {", + " return (left.intValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Integer_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Integer left, final Float right) {", + " return (left.intValue() / right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Integer_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : int) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final int right) {", + " return (left.intValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Integer_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Integer) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Integer right) {", + " return (left.intValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Integer_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Integer left, final AtomicDouble right) {", + " return (left.intValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Integer_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : short) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final short right) {", + " return (left.intValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Integer_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Short) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Short right) {", + " return (left.intValue() / right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Integer_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Integer, right : AtomicInteger) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final AtomicInteger right) {", + " return (left.intValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Integer_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Integer, right : AtomicLong) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final AtomicLong right) {", + " return (left.intValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Integer_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final long right) {", + " return (left.intValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Integer_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final Long right) {", + " return (left.intValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Integer_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : byte) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final byte right) {", + " return (left.intValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Integer_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Byte) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Byte right) {", + " return (left.intValue() * right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Integer_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Integer left, final float right) {", + " return (left.intValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Integer_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Integer left, final Float right) {", + " return (left.intValue() * right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Integer_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : int) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final int right) {", + " return (left.intValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Integer_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Integer) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Integer right) {", + " return (left.intValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Integer_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Integer left, final AtomicDouble right) {", + " return (left.intValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Integer_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : short) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final short right) {", + " return (left.intValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Integer_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Short) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Short right) {", + " return (left.intValue() * right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Integer_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Integer, right : AtomicInteger) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final AtomicInteger right) {", + " return (left.intValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Integer_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Integer, right : AtomicLong) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final AtomicLong right) {", + " return (left.intValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Integer_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final long right) {", + " return (left.intValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Integer_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final Long right) {", + " return (left.intValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Integer_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Byte) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Byte right) {", + " return (left.intValue() % right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Integer_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : byte) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final byte right) {", + " return (left.intValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Integer_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Integer left, final float right) {", + " return (left.intValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Integer_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Integer left, final Float right) {", + " return (left.intValue() % right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Integer_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : int) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final int right) {", + " return (left.intValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Integer_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Integer) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Integer right) {", + " return (left.intValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Integer_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Integer left, final AtomicDouble right) {", + " return (left.intValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Integer_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : short) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final short right) {", + " return (left.intValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Integer_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Short) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Short right) {", + " return (left.intValue() % right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Integer_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Integer, right : AtomicInteger) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final AtomicInteger right) {", + " return (left.intValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Integer_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Integer, right : AtomicLong) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left, final AtomicLong right) {", + " return (left.intValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/intprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/intprimitive/CodeTest.java new file mode 100644 index 0000000000..3967d0d125 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/intprimitive/CodeTest.java @@ -0,0 +1,257 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.intprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveIntArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveIntArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveIntArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveIntArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveIntArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveIntArithmeticExtensions.operator_power; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static int left = 4; + + private static int right = 3; + + @Test + public void operator_minus_int_Number() throws Exception { + assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_minus_int_Long() throws Exception { + assertEquals(1, operator_minus(left, Long.valueOf(right))); + } + + @Test + public void operator_minus_int_Byte() throws Exception { + assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); + } + + @Test + public void operator_minus_int_Float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); + } + + @Test + public void operator_minus_int_Integer() throws Exception { + assertEquals(1, operator_minus(left, Integer.valueOf(right))); + } + + @Test + public void operator_minus_int_Short() throws Exception { + assertEquals(1, operator_minus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_minus_int_AtomicInteger() throws Exception { + assertEquals(1, operator_minus(left, new AtomicInteger(right))); + } + + @Test + public void operator_minus_int_AtomicLong() throws Exception { + assertEquals(1l, operator_minus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_int_Long() throws Exception { + assertEquals(7l, operator_plus(left, Long.valueOf(right))); + } + + @Test + public void operator_plus_int_Byte() throws Exception { + assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_plus_int_Float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); + } + + @Test + public void operator_plus_int_Integer() throws Exception { + assertEquals(7, operator_plus(left, Integer.valueOf(right))); + } + + @Test + public void operator_plus_int_Short() throws Exception { + assertEquals(7, operator_plus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_plus_int_AtomicInteger() throws Exception { + assertEquals(7, operator_plus(left, new AtomicInteger(right))); + } + + @Test + public void operator_plus_int_AtomicLong() throws Exception { + assertEquals(7l, operator_plus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_int_Number() throws Exception { + assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_int_Number() throws Exception { + assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_divide_int_Long() throws Exception { + assertEquals(1l, operator_divide(left, Long.valueOf(right))); + } + + @Test + public void operator_divide_int_Byte() throws Exception { + assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_divide_int_Float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); + } + + @Test + public void operator_divide_int_Integer() throws Exception { + assertEquals(1, operator_divide(left, Integer.valueOf(right))); + } + + @Test + public void operator_divide_int_Number() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_divide_int_Short() throws Exception { + assertEquals(1, operator_divide(left, Short.valueOf((short) right))); + } + + @Test + public void operator_divide_int_AtomicInteger() throws Exception { + assertEquals(1, operator_divide(left, new AtomicInteger(right))); + } + + @Test + public void operator_divide_int_AtomicLong() throws Exception { + assertEquals(1l, operator_divide(left, new AtomicLong(right))); + } + + @Test + public void operator_multiply_int_Long() throws Exception { + assertEquals(12l, operator_multiply(left, Long.valueOf(right))); + } + + @Test + public void operator_multiply_int_Byte() throws Exception { + assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_multiply_int_Float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); + } + + @Test + public void operator_multiply_int_Integer() throws Exception { + assertEquals(12, operator_multiply(left, Integer.valueOf(right))); + } + + @Test + public void operator_multiply_int_Number() throws Exception { + assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_multiply_int_Short() throws Exception { + assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); + } + + @Test + public void operator_multiply_int_AtomicInteger() throws Exception { + assertEquals(12, operator_multiply(left, new AtomicInteger(right))); + } + + @Test + public void operator_multiply_int_AtomicLong() throws Exception { + assertEquals(12l, operator_multiply(left, new AtomicLong(right))); + } + + @Test + public void operator_modulo_int_Long() throws Exception { + assertEquals(1l, operator_modulo(left, Long.valueOf(right))); + } + + @Test + public void operator_modulo_int_Byte() throws Exception { + assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_modulo_int_Float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); + } + + @Test + public void operator_modulo_int_Integer() throws Exception { + assertEquals(1, operator_modulo(left, Integer.valueOf(right))); + } + + @Test + public void operator_modulo_int_Number() throws Exception { + assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_modulo_int_Short() throws Exception { + assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); + } + + @Test + public void operator_modulo_int_AtomicInteger() throws Exception { + assertEquals(1, operator_modulo(left, new AtomicInteger(right))); + } + + @Test + public void operator_modulo_int_AtomicLong() throws Exception { + assertEquals(1l, operator_modulo(left, new AtomicLong(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/intprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/intprimitive/CompilerTest.java new file mode 100644 index 0000000000..18721fca14 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/intprimitive/CompilerTest.java @@ -0,0 +1,1341 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.intprimitive; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_int_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final int left, final AtomicDouble right) {", + " return (left - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_int_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final int left, final Long right) {", + " return (left - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_int_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Byte) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Byte right) {", + " return (left - right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_int_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final int left, final Float right) {", + " return (left - right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_int_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Integer) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Integer right) {", + " return (left - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_int_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Short) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Short right) {", + " return (left - right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_int_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : int, right : AtomicInteger) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final AtomicInteger right) {", + " return (left - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_int_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : int, right : AtomicLong) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final int left, final AtomicLong right) {", + " return (left - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_int_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final int left, final Long right) {", + " return (left + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_int_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Byte) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Byte right) {", + " return (left + right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_int_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final int left, final Float right) {", + " return (left + right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_int_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Integer) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Integer right) {", + " return (left + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_int_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Short) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Short right) {", + " return (left + right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_int_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : int, right : AtomicInteger) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final AtomicInteger right) {", + " return (left + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_int_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final int left, final Long right) {", + " return (left + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_int_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final int left, final AtomicDouble right) {", + " return (left + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_int_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final int left, final AtomicDouble right) {", + " return Math.pow(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_int_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final int left, final Long right) {", + " return (left / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_int_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Byte) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Byte right) {", + " return (left / right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_int_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final int left, final Float right) {", + " return (left / right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_int_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Integer) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Integer right) {", + " return (left / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_int_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final int left, final AtomicDouble right) {", + " return (left / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_int_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Short) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Short right) {", + " return (left / right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_int_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : int, right : AtomicInteger) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final AtomicInteger right) {", + " return (left / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_int_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : int, right : AtomicLong) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final int left, final AtomicLong right) {", + " return (left / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_int_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final int left, final Long right) {", + " return (left * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_int_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Byte) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Byte right) {", + " return (left * right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_int_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final int left, final Float right) {", + " return (left * right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_int_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Integer) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Integer right) {", + " return (left * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_int_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final int left, final AtomicDouble right) {", + " return (left * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_int_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Short) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Short right) {", + " return (left * right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_int_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : int, right : AtomicInteger) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final AtomicInteger right) {", + " return (left * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_int_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : int, right : AtomicLong) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final int left, final AtomicLong right) {", + " return (left * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_int_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final int left, final Long right) {", + " return (left % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_int_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Byte) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Byte right) {", + " return (left % right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_int_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final int left, final Float right) {", + " return (left % right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_int_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Integer) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Integer right) {", + " return (left % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_int_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final int left, final AtomicDouble right) {", + " return (left % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_int_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Short) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Short right) {", + " return (left % right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_int_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : int, right : AtomicInteger) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final AtomicInteger right) {", + " return (left % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_int_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : int, right : AtomicLong) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final int left, final AtomicLong right) {", + " return (left % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/longobject/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/longobject/CodeTest.java new file mode 100644 index 0000000000..f42c09e5cb --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/longobject/CodeTest.java @@ -0,0 +1,417 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.longobject; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.LongArithmeticExtensions.operator_power; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Long left = Long.valueOf(4); + + private static int right = 3; + + @Test + public void operator_minus_Long() throws Exception { + assertEquals(-4, operator_minus(left)); + } + + @Test + public void operator_minus_Long_Number() throws Exception { + assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_minus_Long_long() throws Exception { + assertEquals(1, operator_minus(left, (long) right)); + } + + @Test + public void operator_minus_Long_Long() throws Exception { + assertEquals(1, operator_minus(left, Long.valueOf(right))); + } + + @Test + public void operator_minus_Long_byte() throws Exception { + assertEquals(1, operator_minus(left, (byte)right)); + } + + @Test + public void operator_minus_Long_Byte() throws Exception { + assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); + } + + @Test + public void operator_minus_Long_float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, (float) right)); + } + + @Test + public void operator_minus_Long_Float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); + } + + @Test + public void operator_minus_Long_int() throws Exception { + assertEquals(1, operator_minus(left, (int) right)); + } + + @Test + public void operator_minus_Long_Integer() throws Exception { + assertEquals(1, operator_minus(left, Integer.valueOf(right))); + } + + @Test + public void operator_minus_Long_short() throws Exception { + assertEquals(1, operator_minus(left, (short) right)); + } + + @Test + public void operator_minus_Long_Short() throws Exception { + assertEquals(1, operator_minus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_minus_Long_AtomicInteger() throws Exception { + assertEquals(1, operator_minus(left, new AtomicInteger(right))); + } + + @Test + public void operator_minus_Long_AtomicLong() throws Exception { + assertEquals(1l, operator_minus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_Long_long() throws Exception { + assertEquals(7l, operator_plus(left, (long) right)); + } + + @Test + public void operator_plus_Long_Long() throws Exception { + assertEquals(7l, operator_plus(left, Long.valueOf(right))); + } + + @Test + public void operator_plus_Long_byte() throws Exception { + assertEquals(7, operator_plus(left, (byte) right)); + } + + @Test + public void operator_plus_Long_Byte() throws Exception { + assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_plus_Long_float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, (float) right)); + } + + @Test + public void operator_plus_Long_Float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); + } + + @Test + public void operator_plus_Long_int() throws Exception { + assertEquals(7, operator_plus(left, (int) right)); + } + + @Test + public void operator_plus_Long_Integer() throws Exception { + assertEquals(7, operator_plus(left, Integer.valueOf(right))); + } + + @Test + public void operator_plus_Long_short() throws Exception { + assertEquals(7, operator_plus(left, (short) right)); + } + + @Test + public void operator_plus_Long_Short() throws Exception { + assertEquals(7, operator_plus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_plus_Long_AtomicInteger() throws Exception { + assertEquals(7, operator_plus(left, new AtomicInteger(right))); + } + + @Test + public void operator_plus_Long_AtomicLong() throws Exception { + assertEquals(7l, operator_plus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_Long_Number() throws Exception { + assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_Long_Number() throws Exception { + assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_power_Long_byte() throws Exception { + assertEpsilonEquals(64., operator_power(left, (byte) right)); + } + + @Test + public void operator_power_Long_short() throws Exception { + assertEpsilonEquals(64., operator_power(left, (short) right)); + } + + @Test + public void operator_power_Long_int() throws Exception { + assertEpsilonEquals(64., operator_power(left, (int) right)); + } + + @Test + public void operator_power_Long_long() throws Exception { + assertEpsilonEquals(64., operator_power(left, (long) right)); + } + + @Test + public void operator_power_Long_float() throws Exception { + assertEpsilonEquals(64., operator_power(left, (float) right)); + } + + @Test + public void operator_power_Long_double() throws Exception { + assertEpsilonEquals(64., operator_power(left, (double) right)); + } + + @Test + public void operator_divide_Long_long() throws Exception { + assertEquals(1l, operator_divide(left, (long) right)); + } + + @Test + public void operator_divide_Long_Long() throws Exception { + assertEquals(1l, operator_divide(left, Long.valueOf(right))); + } + + @Test + public void operator_divide_Long_byte() throws Exception { + assertEquals(1l, operator_divide(left, (byte) right)); + } + + @Test + public void operator_divide_Long_Byte() throws Exception { + assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_divide_Long_float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, (float) right)); + } + + @Test + public void operator_divide_Long_Float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); + } + + @Test + public void operator_divide_Long_int() throws Exception { + assertEquals(1, operator_divide(left, (int) right)); + } + + @Test + public void operator_divide_Long_Integer() throws Exception { + assertEquals(1, operator_divide(left, Integer.valueOf(right))); + } + + @Test + public void operator_divide_Long_Number() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_divide_Long_short() throws Exception { + assertEquals(1, operator_divide(left, (short) right)); + } + + @Test + public void operator_divide_Long_Short() throws Exception { + assertEquals(1, operator_divide(left, Short.valueOf((short) right))); + } + + @Test + public void operator_divide_Long_AtomicInteger() throws Exception { + assertEquals(1, operator_divide(left, new AtomicInteger(right))); + } + + @Test + public void operator_divide_Long_AtomicLong() throws Exception { + assertEquals(1l, operator_divide(left, new AtomicLong(right))); + } + + @Test + public void operator_multiply_Long_long() throws Exception { + assertEquals(12l, operator_multiply(left, (long) right)); + } + + @Test + public void operator_multiply_Long_Long() throws Exception { + assertEquals(12l, operator_multiply(left, Long.valueOf(right))); + } + + @Test + public void operator_multiply_Long_byte() throws Exception { + assertEquals(12, operator_multiply(left, (byte) right)); + } + + @Test + public void operator_multiply_Long_Byte() throws Exception { + assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_multiply_Long_float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, (float) right)); + } + + @Test + public void operator_multiply_Long_Float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); + } + + @Test + public void operator_multiply_Long_int() throws Exception { + assertEquals(12, operator_multiply(left, (int) right)); + } + + @Test + public void operator_multiply_Long_Integer() throws Exception { + assertEquals(12, operator_multiply(left, Integer.valueOf(right))); + } + + @Test + public void operator_multiply_Long_Number() throws Exception { + assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_multiply_Long_short() throws Exception { + assertEquals(12, operator_multiply(left, (short) right)); + } + + @Test + public void operator_multiply_Long_Short() throws Exception { + assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); + } + + @Test + public void operator_multiply_Long_AtomicInteger() throws Exception { + assertEquals(12, operator_multiply(left, new AtomicInteger(right))); + } + + @Test + public void operator_multiply_Long_AtomicLong() throws Exception { + assertEquals(12l, operator_multiply(left, new AtomicLong(right))); + } + + @Test + public void operator_modulo_Long_long() throws Exception { + assertEquals(1l, operator_modulo(left, (long) right)); + } + + @Test + public void operator_modulo_Long_Long() throws Exception { + assertEquals(1l, operator_modulo(left, Long.valueOf(right))); + } + + @Test + public void operator_modulo_Long_byte() throws Exception { + assertEquals(1l, operator_modulo(left, (byte) right)); + } + + @Test + public void operator_modulo_Long_Byte() throws Exception { + assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_modulo_Long_float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, (float) right)); + } + + @Test + public void operator_modulo_Long_Float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); + } + + @Test + public void operator_modulo_Long_int() throws Exception { + assertEquals(1, operator_modulo(left, (int) right)); + } + + @Test + public void operator_modulo_Long_Integer() throws Exception { + assertEquals(1, operator_modulo(left, Integer.valueOf(right))); + } + + @Test + public void operator_modulo_Long_Number() throws Exception { + assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_modulo_Long_short() throws Exception { + assertEquals(1, operator_modulo(left, (short) right)); + } + + @Test + public void operator_modulo_Long_Short() throws Exception { + assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); + } + + @Test + public void operator_modulo_Long_AtomicInteger() throws Exception { + assertEquals(1, operator_modulo(left, new AtomicInteger(right))); + } + + @Test + public void operator_modulo_Long_AtomicLong() throws Exception { + assertEquals(1l, operator_modulo(left, new AtomicLong(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/longobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/longobject/CompilerTest.java new file mode 100644 index 0000000000..60edff211f --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/longobject/CompilerTest.java @@ -0,0 +1,2334 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.longobject; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long) : long {", + " -left", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left) {", + " return (-(left.longValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Long_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Long left, final AtomicDouble right) {", + " return (left.longValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Long_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final long right) {", + " return (left.longValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Long_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Long right) {", + " return (left.longValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Long_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : byte) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final byte right) {", + " return (left.longValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Long_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Byte) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Byte right) {", + " return (left.longValue() - right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Long_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Long left, final float right) {", + " return (left.longValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Long_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Long left, final Float right) {", + " return (left.longValue() - right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Long_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : int) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final int right) {", + " return (left.longValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Long_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Integer) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Integer right) {", + " return (left.longValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Long_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : short) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final short right) {", + " return (left.longValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Long_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Short) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Short right) {", + " return (left.longValue() - right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Long_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Long, right : AtomicInteger) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final AtomicInteger right) {", + " return (left.longValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Long_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Long, right : AtomicLong) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final AtomicLong right) {", + " return (left.longValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Long_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Long right) {", + " return (left.longValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Long_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final long right) {", + " return (left.longValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Long_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : byte) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final byte right) {", + " return (left.longValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Long_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Byte) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Byte right) {", + " return (left.longValue() + right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Long_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Long left, final Float right) {", + " return (left.longValue() + right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Long_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Long left, final float right) {", + " return (left.longValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Long_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Integer) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Integer right) {", + " return (left.longValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Long_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : int) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final int right) {", + " return (left.longValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Long_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : short) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final short right) {", + " return (left.longValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Long_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Short) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Short right) {", + " return (left.longValue() + right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Long_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Long, right : AtomicInteger) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final AtomicInteger right) {", + " return (left.longValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Long_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Long right) {", + " return (left.longValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Long_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Long left, final AtomicDouble right) {", + " return (left.longValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Long_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Long left, final AtomicDouble right) {", + " return Math.pow(left.longValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Long_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : byte) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Long left, final byte right) {", + " return Math.pow(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Long_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : short) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Long left, final short right) {", + " return Math.pow(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Long_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : int) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Long left, final int right) {", + " return Math.pow(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Long_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : long) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Long left, final long right) {", + " return Math.pow(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Long_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : float) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Long left, final float right) {", + " return Math.pow(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Long_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : double) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Long left, final double right) {", + " return Math.pow(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Long_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final long right) {", + " return (left.longValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Long_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Long right) {", + " return (left.longValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Long_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : byte) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final byte right) {", + " return (left.longValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Long_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Byte) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Byte right) {", + " return (left.longValue() / right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Long_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Long left, final float right) {", + " return (left.longValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Long_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Long left, final Float right) {", + " return (left.longValue() / right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Long_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : int) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final int right) {", + " return (left.longValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Long_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Integer) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Integer right) {", + " return (left.longValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Long_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Long left, final AtomicDouble right) {", + " return (left.longValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Long_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : short) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final short right) {", + " return (left.longValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Long_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Short) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Short right) {", + " return (left.longValue() / right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Long_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Long, right : AtomicInteger) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final AtomicInteger right) {", + " return (left.longValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Long_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Long, right : AtomicLong) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final AtomicLong right) {", + " return (left.longValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Long_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final long right) {", + " return (left.longValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Long_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Long right) {", + " return (left.longValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Long_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : byte) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final byte right) {", + " return (left.longValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Long_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Byte) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Byte right) {", + " return (left.longValue() * right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Long_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Long left, final float right) {", + " return (left.longValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Long_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Long left, final Float right) {", + " return (left.longValue() * right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Long_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : int) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final int right) {", + " return (left.longValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Long_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Integer) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Integer right) {", + " return (left.longValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Long_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Long left, final AtomicDouble right) {", + " return (left.longValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Long_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : short) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final short right) {", + " return (left.longValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Long_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Short) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Short right) {", + " return (left.longValue() * right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Long_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Long, right : AtomicInteger) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final AtomicInteger right) {", + " return (left.longValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Long_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Long, right : AtomicLong) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final AtomicLong right) {", + " return (left.longValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Long_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final long right) {", + " return (left.longValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Long_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Long right) {", + " return (left.longValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Long_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Byte) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Byte right) {", + " return (left.longValue() % right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Long_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : byte) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final byte right) {", + " return (left.longValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Long_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Long left, final float right) {", + " return (left.longValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Long_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Long left, final Float right) {", + " return (left.longValue() % right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Long_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : int) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final int right) {", + " return (left.longValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Long_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Integer) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Integer right) {", + " return (left.longValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Long_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Long left, final AtomicDouble right) {", + " return (left.longValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Long_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : short) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final short right) {", + " return (left.longValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Long_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Short) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final Short right) {", + " return (left.longValue() % right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Long_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Long, right : AtomicInteger) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final AtomicInteger right) {", + " return (left.longValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Long_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Long, right : AtomicLong) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left, final AtomicLong right) {", + " return (left.longValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/longprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/longprimitive/CodeTest.java new file mode 100644 index 0000000000..257465305c --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/longprimitive/CodeTest.java @@ -0,0 +1,257 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.longprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveLongArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveLongArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveLongArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveLongArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveLongArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveLongArithmeticExtensions.operator_power; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static long left = 4; + + private static int right = 3; + + @Test + public void operator_minus_long_Number() throws Exception { + assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_minus_long_Long() throws Exception { + assertEquals(1, operator_minus(left, Long.valueOf(right))); + } + + @Test + public void operator_minus_long_Byte() throws Exception { + assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); + } + + @Test + public void operator_minus_long_Float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); + } + + @Test + public void operator_minus_long_Integer() throws Exception { + assertEquals(1, operator_minus(left, Integer.valueOf(right))); + } + + @Test + public void operator_minus_long_Short() throws Exception { + assertEquals(1, operator_minus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_minus_long_AtomicInteger() throws Exception { + assertEquals(1, operator_minus(left, new AtomicInteger(right))); + } + + @Test + public void operator_minus_long_AtomicLong() throws Exception { + assertEquals(1l, operator_minus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_long_Long() throws Exception { + assertEquals(7l, operator_plus(left, Long.valueOf(right))); + } + + @Test + public void operator_plus_long_Byte() throws Exception { + assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_plus_long_Float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); + } + + @Test + public void operator_plus_long_Integer() throws Exception { + assertEquals(7, operator_plus(left, Integer.valueOf(right))); + } + + @Test + public void operator_plus_long_Short() throws Exception { + assertEquals(7, operator_plus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_plus_long_AtomicInteger() throws Exception { + assertEquals(7, operator_plus(left, new AtomicInteger(right))); + } + + @Test + public void operator_plus_long_AtomicLong() throws Exception { + assertEquals(7l, operator_plus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_long_Number() throws Exception { + assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_long_Number() throws Exception { + assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_divide_long_Long() throws Exception { + assertEquals(1l, operator_divide(left, Long.valueOf(right))); + } + + @Test + public void operator_divide_long_Byte() throws Exception { + assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_divide_long_Float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); + } + + @Test + public void operator_divide_long_Integer() throws Exception { + assertEquals(1, operator_divide(left, Integer.valueOf(right))); + } + + @Test + public void operator_divide_long_Number() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_divide_long_Short() throws Exception { + assertEquals(1, operator_divide(left, Short.valueOf((short) right))); + } + + @Test + public void operator_divide_long_AtomicInteger() throws Exception { + assertEquals(1, operator_divide(left, new AtomicInteger(right))); + } + + @Test + public void operator_divide_long_AtomicLong() throws Exception { + assertEquals(1l, operator_divide(left, new AtomicLong(right))); + } + + @Test + public void operator_multiply_long_Long() throws Exception { + assertEquals(12l, operator_multiply(left, Long.valueOf(right))); + } + + @Test + public void operator_multiply_long_Byte() throws Exception { + assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_multiply_long_Float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); + } + + @Test + public void operator_multiply_long_Integer() throws Exception { + assertEquals(12, operator_multiply(left, Integer.valueOf(right))); + } + + @Test + public void operator_multiply_long_Number() throws Exception { + assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_multiply_long_Short() throws Exception { + assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); + } + + @Test + public void operator_multiply_long_AtomicInteger() throws Exception { + assertEquals(12, operator_multiply(left, new AtomicInteger(right))); + } + + @Test + public void operator_multiply_long_AtomicLong() throws Exception { + assertEquals(12l, operator_multiply(left, new AtomicLong(right))); + } + + @Test + public void operator_modulo_long_Long() throws Exception { + assertEquals(1l, operator_modulo(left, Long.valueOf(right))); + } + + @Test + public void operator_modulo_long_Byte() throws Exception { + assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_modulo_long_Float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); + } + + @Test + public void operator_modulo_long_Integer() throws Exception { + assertEquals(1, operator_modulo(left, Integer.valueOf(right))); + } + + @Test + public void operator_modulo_long_Number() throws Exception { + assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_modulo_long_Short() throws Exception { + assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); + } + + @Test + public void operator_modulo_long_AtomicInteger() throws Exception { + assertEquals(1, operator_modulo(left, new AtomicInteger(right))); + } + + @Test + public void operator_modulo_long_AtomicLong() throws Exception { + assertEquals(1l, operator_modulo(left, new AtomicLong(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/longprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/longprimitive/CompilerTest.java new file mode 100644 index 0000000000..e1d04040b2 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/longprimitive/CompilerTest.java @@ -0,0 +1,1341 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.longprimitive; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_long_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : long, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final long left, final AtomicDouble right) {", + " return (left - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_long_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Long right) {", + " return (left - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_long_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Byte) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Byte right) {", + " return (left - right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_long_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final long left, final Float right) {", + " return (left - right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_long_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Integer) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Integer right) {", + " return (left - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_long_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Short) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Short right) {", + " return (left - right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_long_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : long, right : AtomicInteger) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final AtomicInteger right) {", + " return (left - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_long_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : long, right : AtomicLong) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final AtomicLong right) {", + " return (left - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_long_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Long right) {", + " return (left + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_long_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Byte) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Byte right) {", + " return (left + right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_long_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final long left, final Float right) {", + " return (left + right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_long_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Integer) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Integer right) {", + " return (left + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_long_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Short) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Short right) {", + " return (left + right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_long_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : long, right : AtomicInteger) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final AtomicInteger right) {", + " return (left + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_long_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Long right) {", + " return (left + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_long_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : long, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final long left, final AtomicDouble right) {", + " return (left + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_long_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : long, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final long left, final AtomicDouble right) {", + " return Math.pow(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_long_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Long right) {", + " return (left / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_long_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Byte) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Byte right) {", + " return (left / right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_long_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final long left, final Float right) {", + " return (left / right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_long_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Integer) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Integer right) {", + " return (left / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_long_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : long, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final long left, final AtomicDouble right) {", + " return (left / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_long_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Short) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Short right) {", + " return (left / right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_long_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : long, right : AtomicInteger) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final AtomicInteger right) {", + " return (left / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_long_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : long, right : AtomicLong) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final AtomicLong right) {", + " return (left / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_long_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Long right) {", + " return (left * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_long_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Byte) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Byte right) {", + " return (left * right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_long_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final long left, final Float right) {", + " return (left * right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_long_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Integer) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Integer right) {", + " return (left * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_long_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : long, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final long left, final AtomicDouble right) {", + " return (left * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_long_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Short) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Short right) {", + " return (left * right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_long_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : long, right : AtomicInteger) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final AtomicInteger right) {", + " return (left * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_long_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : long, right : AtomicLong) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final AtomicLong right) {", + " return (left * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_long_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Long right) {", + " return (left % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_long_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Byte) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Byte right) {", + " return (left % right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_long_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final long left, final Float right) {", + " return (left % right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_long_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Integer) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Integer right) {", + " return (left % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_long_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : long, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final long left, final AtomicDouble right) {", + " return (left % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_long_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long, right : Short) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final Short right) {", + " return (left % right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_long_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : long, right : AtomicInteger) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final AtomicInteger right) {", + " return (left % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_long_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : long, right : AtomicLong) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left, final AtomicLong right) {", + " return (left % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/number/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/number/CodeTest.java new file mode 100644 index 0000000000..9a665422d2 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/number/CodeTest.java @@ -0,0 +1,418 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.number; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.NumberArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.NumberArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.NumberArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.NumberArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.NumberArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.NumberArithmeticExtensions.operator_power; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Number left = new AtomicDouble(4); + + private static int right = 3; + + @Test + public void operator_minus_Number() throws Exception { + assertEpsilonEquals(-4, operator_minus(left)); + } + + @Test + public void operator_minus_Number_Number() throws Exception { + assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_minus_Number_long() throws Exception { + assertEpsilonEquals(1, operator_minus(left, (long) right)); + } + + @Test + public void operator_minus_Number_Long() throws Exception { + assertEpsilonEquals(1, operator_minus(left, Long.valueOf(right))); + } + + @Test + public void operator_minus_Number_byte() throws Exception { + assertEpsilonEquals(1, operator_minus(left, (byte)right)); + } + + @Test + public void operator_minus_Number_Byte() throws Exception { + assertEpsilonEquals(1, operator_minus(left, Byte.valueOf((byte)right))); + } + + @Test + public void operator_minus_Number_float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, (float) right)); + } + + @Test + public void operator_minus_Number_Float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); + } + + @Test + public void operator_minus_Number_int() throws Exception { + assertEpsilonEquals(1, operator_minus(left, (int) right)); + } + + @Test + public void operator_minus_Number_Integer() throws Exception { + assertEpsilonEquals(1, operator_minus(left, Integer.valueOf(right))); + } + + @Test + public void operator_minus_Number_short() throws Exception { + assertEpsilonEquals(1, operator_minus(left, (short) right)); + } + + @Test + public void operator_minus_Number_Short() throws Exception { + assertEpsilonEquals(1, operator_minus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_minus_Number_AtomicInteger() throws Exception { + assertEpsilonEquals(1, operator_minus(left, new AtomicInteger(right))); + } + + @Test + public void operator_minus_Number_AtomicLong() throws Exception { + assertEpsilonEquals(1l, operator_minus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_Number_long() throws Exception { + assertEpsilonEquals(7l, operator_plus(left, (long) right)); + } + + @Test + public void operator_plus_Number_Long() throws Exception { + assertEpsilonEquals(7l, operator_plus(left, Long.valueOf(right))); + } + + @Test + public void operator_plus_Number_byte() throws Exception { + assertEpsilonEquals(7, operator_plus(left, (byte) right)); + } + + @Test + public void operator_plus_Number_Byte() throws Exception { + assertEpsilonEquals(7, operator_plus(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_plus_Number_float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, (float) right)); + } + + @Test + public void operator_plus_Number_Float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); + } + + @Test + public void operator_plus_Number_int() throws Exception { + assertEpsilonEquals(7, operator_plus(left, (int) right)); + } + + @Test + public void operator_plus_Number_Integer() throws Exception { + assertEpsilonEquals(7, operator_plus(left, Integer.valueOf(right))); + } + + @Test + public void operator_plus_Number_short() throws Exception { + assertEpsilonEquals(7, operator_plus(left, (short) right)); + } + + @Test + public void operator_plus_Number_Short() throws Exception { + assertEpsilonEquals(7, operator_plus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_plus_Number_AtomicInteger() throws Exception { + assertEpsilonEquals(7, operator_plus(left, new AtomicInteger(right))); + } + + @Test + public void operator_plus_Number_AtomicLong() throws Exception { + assertEpsilonEquals(7l, operator_plus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_Number_Number() throws Exception { + assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_Number_Number() throws Exception { + assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_power_Number_byte() throws Exception { + assertEpsilonEquals(64., operator_power(left, (byte) right)); + } + + @Test + public void operator_power_Number_short() throws Exception { + assertEpsilonEquals(64., operator_power(left, (short) right)); + } + + @Test + public void operator_power_Number_int() throws Exception { + assertEpsilonEquals(64., operator_power(left, (int) right)); + } + + @Test + public void operator_power_Number_long() throws Exception { + assertEpsilonEquals(64., operator_power(left, (long) right)); + } + + @Test + public void operator_power_Number_float() throws Exception { + assertEpsilonEquals(64., operator_power(left, (float) right)); + } + + @Test + public void operator_power_Number_double() throws Exception { + assertEpsilonEquals(64., operator_power(left, (double) right)); + } + + @Test + public void operator_divide_Number_long() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (long) right)); + } + + @Test + public void operator_divide_Number_Long() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Long.valueOf(right))); + } + + @Test + public void operator_divide_Number_byte() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (byte) right)); + } + + @Test + public void operator_divide_Number_Byte() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_divide_Number_float() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (float) right)); + } + + @Test + public void operator_divide_Number_Float() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Float.valueOf(right))); + } + + @Test + public void operator_divide_Number_int() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (int) right)); + } + + @Test + public void operator_divide_Number_Integer() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Integer.valueOf(right))); + } + + @Test + public void operator_divide_Number_Number() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_divide_Number_short() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, (short) right)); + } + + @Test + public void operator_divide_Number_Short() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, Short.valueOf((short) right))); + } + + @Test + public void operator_divide_Number_AtomicInteger() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, new AtomicInteger(right))); + } + + @Test + public void operator_divide_Number_AtomicLong() throws Exception { + assertEpsilonEquals(1.333333333333333333333, operator_divide(left, new AtomicLong(right))); + } + + @Test + public void operator_multiply_Number_long() throws Exception { + assertEpsilonEquals(12l, operator_multiply(left, (long) right)); + } + + @Test + public void operator_multiply_Number_Long() throws Exception { + assertEpsilonEquals(12l, operator_multiply(left, Long.valueOf(right))); + } + + @Test + public void operator_multiply_Number_byte() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, (byte) right)); + } + + @Test + public void operator_multiply_Number_Byte() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_multiply_Number_float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, (float) right)); + } + + @Test + public void operator_multiply_Number_Float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); + } + + @Test + public void operator_multiply_Number_int() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, (int) right)); + } + + @Test + public void operator_multiply_Number_Integer() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, Integer.valueOf(right))); + } + + @Test + public void operator_multiply_Number_Number() throws Exception { + assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_multiply_Number_short() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, (short) right)); + } + + @Test + public void operator_multiply_Number_Short() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, Short.valueOf((short) right))); + } + + @Test + public void operator_multiply_Number_AtomicInteger() throws Exception { + assertEpsilonEquals(12, operator_multiply(left, new AtomicInteger(right))); + } + + @Test + public void operator_multiply_Number_AtomicLong() throws Exception { + assertEpsilonEquals(12l, operator_multiply(left, new AtomicLong(right))); + } + + @Test + public void operator_modulo_Number_long() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, (long) right)); + } + + @Test + public void operator_modulo_Number_Long() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, Long.valueOf(right))); + } + + @Test + public void operator_modulo_Number_byte() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, (byte) right)); + } + + @Test + public void operator_modulo_Number_Byte() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_modulo_Number_float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, (float) right)); + } + + @Test + public void operator_modulo_Number_Float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); + } + + @Test + public void operator_modulo_Number_int() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, (int) right)); + } + + @Test + public void operator_modulo_Number_Integer() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, Integer.valueOf(right))); + } + + @Test + public void operator_modulo_Number_Number() throws Exception { + assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_modulo_Number_short() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, (short) right)); + } + + @Test + public void operator_modulo_Number_Short() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, Short.valueOf((short) right))); + } + + @Test + public void operator_modulo_Number_AtomicInteger() throws Exception { + assertEpsilonEquals(1, operator_modulo(left, new AtomicInteger(right))); + } + + @Test + public void operator_modulo_Number_AtomicLong() throws Exception { + assertEpsilonEquals(1l, operator_modulo(left, new AtomicLong(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/number/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/number/CompilerTest.java new file mode 100644 index 0000000000..625c6c572a --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/number/CompilerTest.java @@ -0,0 +1,2334 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.number; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number) : double {", + " -left", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left) {", + " return (-(left.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Number_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicDouble right) {", + " return (left.doubleValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Number_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : long) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final long right) {", + " return (left.doubleValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Number_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Long) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Long right) {", + " return (left.doubleValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Number_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : byte) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final byte right) {", + " return (left.doubleValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Number_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Byte) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Byte right) {", + " return (left.doubleValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Number_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : float) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final float right) {", + " return (left.doubleValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Number_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Float) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Float right) {", + " return (left.doubleValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Number_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : int) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final int right) {", + " return (left.doubleValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Number_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Integer) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Integer right) {", + " return (left.doubleValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Number_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : short) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final short right) {", + " return (left.doubleValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Number_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Short) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Short right) {", + " return (left.doubleValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Number_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Number, right : AtomicInteger) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicInteger right) {", + " return (left.doubleValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Number_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Number, right : AtomicLong) : double {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicLong right) {", + " return (left.doubleValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Number_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Long) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Long right) {", + " return (left.doubleValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Number_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : long) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final long right) {", + " return (left.doubleValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Number_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : byte) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final byte right) {", + " return (left.doubleValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Number_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Byte) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Byte right) {", + " return (left.doubleValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Number_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Float) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Float right) {", + " return (left.doubleValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Number_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : float) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final float right) {", + " return (left.doubleValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Number_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Integer) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Integer right) {", + " return (left.doubleValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Number_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : int) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final int right) {", + " return (left.doubleValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Number_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : short) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final short right) {", + " return (left.doubleValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Number_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Short) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Short right) {", + " return (left.doubleValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Number_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Number, right : AtomicInteger) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicInteger right) {", + " return (left.doubleValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Number_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Long) : double {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Long right) {", + " return (left.doubleValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Number_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicDouble right) {", + " return (left.doubleValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Number_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicDouble right) {", + " return Math.pow(left.doubleValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Number_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : byte) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final byte right) {", + " return Math.pow(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Number_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : short) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final short right) {", + " return Math.pow(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Number_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : int) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final int right) {", + " return Math.pow(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Number_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : long) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final long right) {", + " return Math.pow(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Number_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : float) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final float right) {", + " return Math.pow(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Number_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : double) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final double right) {", + " return Math.pow(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Number_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : long) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final long right) {", + " return (left.doubleValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Number_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Long) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Long right) {", + " return (left.doubleValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Number_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : byte) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final byte right) {", + " return (left.doubleValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Number_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Byte) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Byte right) {", + " return (left.doubleValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Number_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : float) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final float right) {", + " return (left.doubleValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Number_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Float) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Float right) {", + " return (left.doubleValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Number_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : int) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final int right) {", + " return (left.doubleValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Number_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Integer) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Integer right) {", + " return (left.doubleValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Number_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicDouble right) {", + " return (left.doubleValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Number_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : short) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final short right) {", + " return (left.doubleValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Number_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Short) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Short right) {", + " return (left.doubleValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Number_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Number, right : AtomicInteger) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicInteger right) {", + " return (left.doubleValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Number_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Number, right : AtomicLong) : double {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicLong right) {", + " return (left.doubleValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Number_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : long) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final long right) {", + " return (left.doubleValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Number_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Long) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Long right) {", + " return (left.doubleValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Number_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : byte) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final byte right) {", + " return (left.doubleValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Number_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Byte) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Byte right) {", + " return (left.doubleValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Number_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : float) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final float right) {", + " return (left.doubleValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Number_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Float) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Float right) {", + " return (left.doubleValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Number_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : int) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final int right) {", + " return (left.doubleValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Number_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Integer) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Integer right) {", + " return (left.doubleValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Number_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicDouble right) {", + " return (left.doubleValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Number_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : short) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final short right) {", + " return (left.doubleValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Number_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Short) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Short right) {", + " return (left.doubleValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Number_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Number, right : AtomicInteger) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicInteger right) {", + " return (left.doubleValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Number_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Number, right : AtomicLong) : double {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicLong right) {", + " return (left.doubleValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Number_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : long) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final long right) {", + " return (left.doubleValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Number_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Long) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Long right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Number_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Byte) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Byte right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Number_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : byte) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final byte right) {", + " return (left.doubleValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Number_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : float) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final float right) {", + " return (left.doubleValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Number_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Float) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Float right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Number_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : int) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final int right) {", + " return (left.doubleValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Number_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Integer) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Integer right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Number_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicDouble right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Number_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : short) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final short right) {", + " return (left.doubleValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Number_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Short) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final Short right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Number_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Number, right : AtomicInteger) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicInteger right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Number_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Number, right : AtomicLong) : double {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Number left, final AtomicLong right) {", + " return (left.doubleValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/shortobject/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/shortobject/CodeTest.java new file mode 100644 index 0000000000..974d344296 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/shortobject/CodeTest.java @@ -0,0 +1,418 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.shortobject; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.ShortArithmeticExtensions.operator_power; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Short left = 4; + + private static int right = 3; + + @Test + public void operator_minus_Short() throws Exception { + assertEquals(-4, operator_minus(left)); + } + + @Test + public void operator_minus_Short_Number() throws Exception { + assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_minus_Short_long() throws Exception { + assertEquals(1, operator_minus(left, (long) right)); + } + + @Test + public void operator_minus_Short_Long() throws Exception { + assertEquals(1, operator_minus(left, Long.valueOf(right))); + } + + @Test + public void operator_minus_Short_byte() throws Exception { + assertEquals(1, operator_minus(left, (byte)right)); + } + + @Test + public void operator_minus_Short_Byte() throws Exception { + assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); + } + + @Test + public void operator_minus_Short_float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, (float) right)); + } + + @Test + public void operator_minus_Short_Float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); + } + + @Test + public void operator_minus_Short_int() throws Exception { + assertEquals(1, operator_minus(left, (int) right)); + } + + @Test + public void operator_minus_Short_Integer() throws Exception { + assertEquals(1, operator_minus(left, Integer.valueOf(right))); + } + + @Test + public void operator_minus_Short_short() throws Exception { + assertEquals(1, operator_minus(left, (short) right)); + } + + @Test + public void operator_minus_Short_Short() throws Exception { + assertEquals(1, operator_minus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_minus_Short_AtomicInteger() throws Exception { + assertEquals(1, operator_minus(left, new AtomicInteger(right))); + } + + @Test + public void operator_minus_Short_AtomicLong() throws Exception { + assertEquals(1l, operator_minus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_Short_long() throws Exception { + assertEquals(7l, operator_plus(left, (long) right)); + } + + @Test + public void operator_plus_Short_Long() throws Exception { + assertEquals(7l, operator_plus(left, Long.valueOf(right))); + } + + @Test + public void operator_plus_Short_byte() throws Exception { + assertEquals(7, operator_plus(left, (byte) right)); + } + + @Test + public void operator_plus_Short_Byte() throws Exception { + assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_plus_Short_float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, (float) right)); + } + + @Test + public void operator_plus_Short_Float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); + } + + @Test + public void operator_plus_Short_int() throws Exception { + assertEquals(7, operator_plus(left, (int) right)); + } + + @Test + public void operator_plus_Short_Integer() throws Exception { + assertEquals(7, operator_plus(left, Integer.valueOf(right))); + } + + @Test + public void operator_plus_Short_short() throws Exception { + assertEquals(7, operator_plus(left, (short) right)); + } + + @Test + public void operator_plus_Short_Short() throws Exception { + assertEquals(7, operator_plus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_plus_Short_AtomicInteger() throws Exception { + assertEquals(7, operator_plus(left, new AtomicInteger(right))); + } + + @Test + public void operator_plus_Short_AtomicLong() throws Exception { + assertEquals(7l, operator_plus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_Short_Number() throws Exception { + assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_Short_Number() throws Exception { + assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); + } + + + @Test + public void operator_power_Short_byte() throws Exception { + assertEpsilonEquals(64., operator_power(left, (byte) right)); + } + + @Test + public void operator_power_Short_short() throws Exception { + assertEpsilonEquals(64., operator_power(left, (short) right)); + } + + @Test + public void operator_power_Short_int() throws Exception { + assertEpsilonEquals(64., operator_power(left, (int) right)); + } + + @Test + public void operator_power_Short_long() throws Exception { + assertEpsilonEquals(64., operator_power(left, (long) right)); + } + + @Test + public void operator_power_Short_float() throws Exception { + assertEpsilonEquals(64., operator_power(left, (float) right)); + } + + @Test + public void operator_power_Short_double() throws Exception { + assertEpsilonEquals(64., operator_power(left, (double) right)); + } + + @Test + public void operator_divide_Short_long() throws Exception { + assertEquals(1l, operator_divide(left, (long) right)); + } + + @Test + public void operator_divide_Short_Long() throws Exception { + assertEquals(1l, operator_divide(left, Long.valueOf(right))); + } + + @Test + public void operator_divide_Short_byte() throws Exception { + assertEquals(1l, operator_divide(left, (byte) right)); + } + + @Test + public void operator_divide_Short_Byte() throws Exception { + assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_divide_Short_float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, (float) right)); + } + + @Test + public void operator_divide_Short_Float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); + } + + @Test + public void operator_divide_Short_int() throws Exception { + assertEquals(1, operator_divide(left, (int) right)); + } + + @Test + public void operator_divide_Short_Integer() throws Exception { + assertEquals(1, operator_divide(left, Integer.valueOf(right))); + } + + @Test + public void operator_divide_Short_Number() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_divide_Short_short() throws Exception { + assertEquals(1, operator_divide(left, (short) right)); + } + + @Test + public void operator_divide_Short_Short() throws Exception { + assertEquals(1, operator_divide(left, Short.valueOf((short) right))); + } + + @Test + public void operator_divide_Short_AtomicInteger() throws Exception { + assertEquals(1, operator_divide(left, new AtomicInteger(right))); + } + + @Test + public void operator_divide_Short_AtomicLong() throws Exception { + assertEquals(1l, operator_divide(left, new AtomicLong(right))); + } + + @Test + public void operator_multiply_Short_long() throws Exception { + assertEquals(12l, operator_multiply(left, (long) right)); + } + + @Test + public void operator_multiply_Short_Long() throws Exception { + assertEquals(12l, operator_multiply(left, Long.valueOf(right))); + } + + @Test + public void operator_multiply_Short_byte() throws Exception { + assertEquals(12, operator_multiply(left, (byte) right)); + } + + @Test + public void operator_multiply_Short_Byte() throws Exception { + assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_multiply_Short_float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, (float) right)); + } + + @Test + public void operator_multiply_Short_Float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); + } + + @Test + public void operator_multiply_Short_int() throws Exception { + assertEquals(12, operator_multiply(left, (int) right)); + } + + @Test + public void operator_multiply_Short_Integer() throws Exception { + assertEquals(12, operator_multiply(left, Integer.valueOf(right))); + } + + @Test + public void operator_multiply_Short_Number() throws Exception { + assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_multiply_Short_short() throws Exception { + assertEquals(12, operator_multiply(left, (short) right)); + } + + @Test + public void operator_multiply_Short_Short() throws Exception { + assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); + } + + @Test + public void operator_multiply_Short_AtomicInteger() throws Exception { + assertEquals(12, operator_multiply(left, new AtomicInteger(right))); + } + + @Test + public void operator_multiply_Short_AtomicLong() throws Exception { + assertEquals(12l, operator_multiply(left, new AtomicLong(right))); + } + + @Test + public void operator_modulo_Short_long() throws Exception { + assertEquals(1l, operator_modulo(left, (long) right)); + } + + @Test + public void operator_modulo_Short_Long() throws Exception { + assertEquals(1l, operator_modulo(left, Long.valueOf(right))); + } + + @Test + public void operator_modulo_Short_byte() throws Exception { + assertEquals(1l, operator_modulo(left, (byte) right)); + } + + @Test + public void operator_modulo_Short_Byte() throws Exception { + assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_modulo_Short_float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, (float) right)); + } + + @Test + public void operator_modulo_Short_Float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); + } + + @Test + public void operator_modulo_Short_int() throws Exception { + assertEquals(1, operator_modulo(left, (int) right)); + } + + @Test + public void operator_modulo_Short_Integer() throws Exception { + assertEquals(1, operator_modulo(left, Integer.valueOf(right))); + } + + @Test + public void operator_modulo_Short_Number() throws Exception { + assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_modulo_Short_short() throws Exception { + assertEquals(1, operator_modulo(left, (short) right)); + } + + @Test + public void operator_modulo_Short_Short() throws Exception { + assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); + } + + @Test + public void operator_modulo_Short_AtomicInteger() throws Exception { + assertEquals(1, operator_modulo(left, new AtomicInteger(right))); + } + + @Test + public void operator_modulo_Short_AtomicLong() throws Exception { + assertEquals(1l, operator_modulo(left, new AtomicLong(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/shortobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/shortobject/CompilerTest.java new file mode 100644 index 0000000000..02cda4a635 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/shortobject/CompilerTest.java @@ -0,0 +1,2334 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.shortobject; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short) : int {", + " -left", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left) {", + " return (-(left.shortValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Short left, final AtomicDouble right) {", + " return (left.shortValue() - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final long right) {", + " return (left.shortValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final Long right) {", + " return (left.shortValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : byte) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final byte right) {", + " return (left.shortValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Byte) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Byte right) {", + " return (left.shortValue() - right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Short left, final float right) {", + " return (left.shortValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Short left, final Float right) {", + " return (left.shortValue() - right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : int) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final int right) {", + " return (left.shortValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Integer) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Integer right) {", + " return (left.shortValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : short) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final short right) {", + " return (left.shortValue() - right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Short) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Short right) {", + " return (left.shortValue() - right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Short, right : AtomicInteger) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final AtomicInteger right) {", + " return (left.shortValue() - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_Short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Short, right : AtomicLong) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final AtomicLong right) {", + " return (left.shortValue() - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final Long right) {", + " return (left.shortValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final long right) {", + " return (left.shortValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : byte) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final byte right) {", + " return (left.shortValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Byte) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Byte right) {", + " return (left.shortValue() + right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Short left, final Float right) {", + " return (left.shortValue() + right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Short left, final float right) {", + " return (left.shortValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Integer) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Integer right) {", + " return (left.shortValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : int) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final int right) {", + " return (left.shortValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : short) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final short right) {", + " return (left.shortValue() + right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Short) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Short right) {", + " return (left.shortValue() + right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Short, right : AtomicInteger) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final AtomicInteger right) {", + " return (left.shortValue() + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final Long right) {", + " return (left.shortValue() + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_Short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Short left, final AtomicDouble right) {", + " return (left.shortValue() + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Short left, final AtomicDouble right) {", + " return Math.pow(left.shortValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : byte) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Short left, final byte right) {", + " return Math.pow(left.shortValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : short) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Short left, final short right) {", + " return Math.pow(left.shortValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : int) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Short left, final int right) {", + " return Math.pow(left.shortValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : long) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Short left, final long right) {", + " return Math.pow(left.shortValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : float) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Short left, final float right) {", + " return Math.pow(left.shortValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_Short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : double) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Short left, final double right) {", + " return Math.pow(left.shortValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final long right) {", + " return (left.shortValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final Long right) {", + " return (left.shortValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : byte) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final byte right) {", + " return (left.shortValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Byte) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Byte right) {", + " return (left.shortValue() / right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Short left, final float right) {", + " return (left.shortValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Short left, final Float right) {", + " return (left.shortValue() / right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : int) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final int right) {", + " return (left.shortValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Integer) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Integer right) {", + " return (left.shortValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Short left, final AtomicDouble right) {", + " return (left.shortValue() / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : short) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final short right) {", + " return (left.shortValue() / right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Short) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Short right) {", + " return (left.shortValue() / right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Short, right : AtomicInteger) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final AtomicInteger right) {", + " return (left.shortValue() / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_Short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Short, right : AtomicLong) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final AtomicLong right) {", + " return (left.shortValue() / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final long right) {", + " return (left.shortValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final Long right) {", + " return (left.shortValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : byte) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final byte right) {", + " return (left.shortValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Byte) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Byte right) {", + " return (left.shortValue() * right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Short left, final float right) {", + " return (left.shortValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Short left, final Float right) {", + " return (left.shortValue() * right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : int) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final int right) {", + " return (left.shortValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Integer) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Integer right) {", + " return (left.shortValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Short left, final AtomicDouble right) {", + " return (left.shortValue() * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : short) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final short right) {", + " return (left.shortValue() * right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Short) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Short right) {", + " return (left.shortValue() * right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Short, right : AtomicInteger) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final AtomicInteger right) {", + " return (left.shortValue() * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_Short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Short, right : AtomicLong) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final AtomicLong right) {", + " return (left.shortValue() * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final long right) {", + " return (left.shortValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final Long right) {", + " return (left.shortValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Byte) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Byte right) {", + " return (left.shortValue() % right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : byte) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final byte right) {", + " return (left.shortValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Short left, final float right) {", + " return (left.shortValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Short left, final Float right) {", + " return (left.shortValue() % right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : int) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final int right) {", + " return (left.shortValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Integer) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Integer right) {", + " return (left.shortValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Short left, final AtomicDouble right) {", + " return (left.shortValue() % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : short) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final short right) {", + " return (left.shortValue() % right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Short) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Short right) {", + " return (left.shortValue() % right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Short, right : AtomicInteger) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final AtomicInteger right) {", + " return (left.shortValue() % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_Short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Short, right : AtomicLong) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left, final AtomicLong right) {", + " return (left.shortValue() % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/shortprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/shortprimitive/CodeTest.java new file mode 100644 index 0000000000..36ab8b88a1 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/shortprimitive/CodeTest.java @@ -0,0 +1,257 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.shortprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveShortArithmeticExtensions.operator_divide; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveShortArithmeticExtensions.operator_minus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveShortArithmeticExtensions.operator_modulo; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveShortArithmeticExtensions.operator_multiply; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveShortArithmeticExtensions.operator_plus; +import static io.sarl.lang.scoping.extensions.numbers.arithmetic.PrimitiveShortArithmeticExtensions.operator_power; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static short left = 4; + + private static int right = 3; + + @Test + public void operator_minus_short_Number() throws Exception { + assertEpsilonEquals(1., operator_minus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_minus_short_Long() throws Exception { + assertEquals(1, operator_minus(left, Long.valueOf(right))); + } + + @Test + public void operator_minus_short_Byte() throws Exception { + assertEquals(1, operator_minus(left, Byte.valueOf((byte)right))); + } + + @Test + public void operator_minus_short_Float() throws Exception { + assertEpsilonEquals(1f, operator_minus(left, Float.valueOf(right))); + } + + @Test + public void operator_minus_short_Integer() throws Exception { + assertEquals(1, operator_minus(left, Integer.valueOf(right))); + } + + @Test + public void operator_minus_short_Short() throws Exception { + assertEquals(1, operator_minus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_minus_short_AtomicInteger() throws Exception { + assertEquals(1, operator_minus(left, new AtomicInteger(right))); + } + + @Test + public void operator_minus_short_AtomicLong() throws Exception { + assertEquals(1l, operator_minus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_short_Long() throws Exception { + assertEquals(7l, operator_plus(left, Long.valueOf(right))); + } + + @Test + public void operator_plus_short_Byte() throws Exception { + assertEquals(7, operator_plus(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_plus_short_Float() throws Exception { + assertEpsilonEquals(7f, operator_plus(left, Float.valueOf(right))); + } + + @Test + public void operator_plus_short_Integer() throws Exception { + assertEquals(7, operator_plus(left, Integer.valueOf(right))); + } + + @Test + public void operator_plus_short_Short() throws Exception { + assertEquals(7, operator_plus(left, Short.valueOf((short) right))); + } + + @Test + public void operator_plus_short_AtomicInteger() throws Exception { + assertEquals(7, operator_plus(left, new AtomicInteger(right))); + } + + @Test + public void operator_plus_short_AtomicLong() throws Exception { + assertEquals(7l, operator_plus(left, new AtomicLong(right))); + } + + @Test + public void operator_plus_short_Number() throws Exception { + assertEpsilonEquals(7., operator_plus(left, (Number) Double.valueOf(right))); + } + + @Test + public void operator_power_short_Number() throws Exception { + assertEpsilonEquals(64., operator_power(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_divide_short_Long() throws Exception { + assertEquals(1l, operator_divide(left, Long.valueOf(right))); + } + + @Test + public void operator_divide_short_Byte() throws Exception { + assertEquals(1l, operator_divide(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_divide_short_Float() throws Exception { + assertEpsilonEquals(1.33333333333333333f, operator_divide(left, Float.valueOf(right))); + } + + @Test + public void operator_divide_short_Integer() throws Exception { + assertEquals(1, operator_divide(left, Integer.valueOf(right))); + } + + @Test + public void operator_divide_short_Number() throws Exception { + assertEpsilonEquals(1.333333333333333333, operator_divide(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_divide_short_Short() throws Exception { + assertEquals(1, operator_divide(left, Short.valueOf((short) right))); + } + + @Test + public void operator_divide_short_AtomicInteger() throws Exception { + assertEquals(1, operator_divide(left, new AtomicInteger(right))); + } + + @Test + public void operator_divide_short_AtomicLong() throws Exception { + assertEquals(1l, operator_divide(left, new AtomicLong(right))); + } + + @Test + public void operator_multiply_short_Long() throws Exception { + assertEquals(12l, operator_multiply(left, Long.valueOf(right))); + } + + @Test + public void operator_multiply_short_Byte() throws Exception { + assertEquals(12, operator_multiply(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_multiply_short_Float() throws Exception { + assertEpsilonEquals(12f, operator_multiply(left, Float.valueOf(right))); + } + + @Test + public void operator_multiply_short_Integer() throws Exception { + assertEquals(12, operator_multiply(left, Integer.valueOf(right))); + } + + @Test + public void operator_multiply_short_Number() throws Exception { + assertEpsilonEquals(12., operator_multiply(left, (Number) Long.valueOf(right))); + } + + @Test + public void operator_multiply_short_Short() throws Exception { + assertEquals(12, operator_multiply(left, Short.valueOf((short) right))); + } + + @Test + public void operator_multiply_short_AtomicInteger() throws Exception { + assertEquals(12, operator_multiply(left, new AtomicInteger(right))); + } + + @Test + public void operator_multiply_short_AtomicLong() throws Exception { + assertEquals(12l, operator_multiply(left, new AtomicLong(right))); + } + + @Test + public void operator_modulo_short_Long() throws Exception { + assertEquals(1l, operator_modulo(left, Long.valueOf(right))); + } + + @Test + public void operator_modulo_short_Byte() throws Exception { + assertEquals(1l, operator_modulo(left, Byte.valueOf((byte) right))); + } + + @Test + public void operator_modulo_short_Float() throws Exception { + assertEpsilonEquals(1f, operator_modulo(left, Float.valueOf(right))); + } + + @Test + public void operator_modulo_short_Integer() throws Exception { + assertEquals(1, operator_modulo(left, Integer.valueOf(right))); + } + + @Test + public void operator_modulo_short_Number() throws Exception { + assertEpsilonEquals(1., operator_modulo(left, (Number) Integer.valueOf(right))); + } + + @Test + public void operator_modulo_short_Short() throws Exception { + assertEquals(1, operator_modulo(left, Short.valueOf((short) right))); + } + + @Test + public void operator_modulo_short_AtomicInteger() throws Exception { + assertEquals(1, operator_modulo(left, new AtomicInteger(right))); + } + + @Test + public void operator_modulo_short_AtomicLong() throws Exception { + assertEquals(1l, operator_modulo(left, new AtomicLong(right))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/shortprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/shortprimitive/CompilerTest.java new file mode 100644 index 0000000000..a4f78368b6 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/arithmetic/shortprimitive/CompilerTest.java @@ -0,0 +1,1341 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.arithmetic.shortprimitive; + +import org.junit.Test; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_minus_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : double {", + " left - right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final short left, final AtomicDouble right) {", + " return (left - right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final short left, final Long right) {", + " return (left - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Byte right) {", + " return (left - right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : float {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final short left, final Float right) {", + " return (left - right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Integer right) {", + " return (left - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Short right) {", + " return (left - right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : int {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final AtomicInteger right) {", + " return (left - right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_minus_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : long {", + " left - right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final short left, final AtomicLong right) {", + " return (left - right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final short left, final Long right) {", + " return (left + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Byte right) {", + " return (left + right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : float {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final short left, final Float right) {", + " return (left + right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Integer right) {", + " return (left + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Short right) {", + " return (left + right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : int {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final AtomicInteger right) {", + " return (left + right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : long {", + " left + right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final short left, final Long right) {", + " return (left + right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_plus_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : double {", + " left + right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final short left, final AtomicDouble right) {", + " return (left + right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_power_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : double {", + " left ** right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final short left, final AtomicDouble right) {", + " return Math.pow(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final short left, final Long right) {", + " return (left / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Byte right) {", + " return (left / right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : float {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final short left, final Float right) {", + " return (left / right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Integer right) {", + " return (left / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : double {", + " left / right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final short left, final AtomicDouble right) {", + " return (left / right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Short right) {", + " return (left / right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : int {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final AtomicInteger right) {", + " return (left / right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_divide_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : long {", + " left / right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final short left, final AtomicLong right) {", + " return (left / right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final short left, final Long right) {", + " return (left * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Byte right) {", + " return (left * right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : float {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final short left, final Float right) {", + " return (left * right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Integer right) {", + " return (left * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : double {", + " left * right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final short left, final AtomicDouble right) {", + " return (left * right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Short right) {", + " return (left * right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : int {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final AtomicInteger right) {", + " return (left * right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_multiply_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : long {", + " left * right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final short left, final AtomicLong right) {", + " return (left * right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final short left, final Long right) {", + " return (left % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Byte right) {", + " return (left % right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : float {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final short left, final Float right) {", + " return (left % right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Integer right) {", + " return (left % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : double {", + " left % right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final short left, final AtomicDouble right) {", + " return (left % right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Short right) {", + " return (left % right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : int {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final AtomicInteger right) {", + " return (left % right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_modulo_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : long {", + " left % right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final short left, final AtomicLong right) {", + " return (left % right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/AtomicDoubleCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/AtomicDoubleCastExtensionsTest.java deleted file mode 100644 index 1823e6a854..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/AtomicDoubleCastExtensionsTest.java +++ /dev/null @@ -1,387 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toByte; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toDouble; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toDoubleObject; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toFloat; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toInt; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toLong; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toShort; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - AtomicDoubleCastExtensionsTest.Code.class, - AtomicDoubleCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class AtomicDoubleCastExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static AtomicDouble left = new AtomicDouble(4); - - @Test - public void toFloat_AtomicLong() { - assertEpsilonEquals(4, toFloat(left)); - } - - @Test - public void toByte_AtomicLong() { - assertEquals(4, toByte(left)); - } - - @Test - public void toLong_AtomicLong() { - assertEquals(4, toLong(left)); - } - - @Test - public void toDouble_AtomicLong() { - assertEpsilonEquals(4, toDouble(left)); - } - - @Test - public void toShort_AtomicLong() { - assertEquals(4, toShort(left)); - } - - @Test - public void toInt_AtomicLong() { - assertEquals(4, toInt(left)); - } - - @Test - public void toIntegerInteger_AtomicLong() { - Double value = toDoubleObject(left); - assertNotNull(value); - assertEpsilonEquals(4, value.doubleValue()); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : byte {", - " left as byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to byte"); - } - - @Test - public void as_short() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : short {", - " left as short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to Short"); - } - - @Test - public void as_int() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : int {", - " left as int", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to int"); - } - - @Test - public void as_long() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : long {", - " left as long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to long"); - } - - @Test - public void as_float() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : float {", - " left as float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to float"); - } - - @Test - public void as_double() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : double {", - " left as double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to double"); - } - - @Test - public void as_Byte() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : Byte {", - " left as Byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to byte"); - } - - @Test - public void as_Short() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : Short {", - " left as Short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to Short"); - } - - @Test - public void as_Integer() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : Integer {", - " left as Integer", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to Integer"); - } - - @Test - public void as_Long() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : Long {", - " left as Long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to Long"); - } - - @Test - public void as_Float() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : Float {", - " left as Float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to Float"); - } - - @Test - public void as_Double() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : Double {", - " left as Double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to Double"); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicDouble) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicInteger", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicDouble) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicDouble to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : AtomicDouble {", - " left as AtomicDouble", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public AtomicDouble fct(final AtomicDouble left) {", - " return ((AtomicDouble) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : AtomicDouble) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final AtomicDouble left) {", - " return ((Number) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/AtomicIntegerCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/AtomicIntegerCastExtensionsTest.java deleted file mode 100644 index 8a0f8d2b2d..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/AtomicIntegerCastExtensionsTest.java +++ /dev/null @@ -1,387 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toByte; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toDouble; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toFloat; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toInt; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toInteger; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toLong; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toShort; - -import java.util.concurrent.atomic.AtomicInteger; - -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - AtomicIntegerCastExtensionsTest.Code.class, - AtomicIntegerCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class AtomicIntegerCastExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static AtomicInteger left = new AtomicInteger(4); - - @Test - public void toFloat_AtomicInteger() { - assertEpsilonEquals(4, toFloat(left)); - } - - @Test - public void toByte_AtomicInteger() { - assertEquals(4, toByte(left)); - } - - @Test - public void toLong_AtomicInteger() { - assertEquals(4, toLong(left)); - } - - @Test - public void toDouble_AtomicInteger() { - assertEpsilonEquals(4, toDouble(left)); - } - - @Test - public void toShort_AtomicInteger() { - assertEquals(4, toShort(left)); - } - - @Test - public void toInt_AtomicInteger() { - assertEquals(4, toInt(left)); - } - - @Test - public void toInteger_AtomicInteger() { - Integer value = toInteger(left); - assertNotNull(value); - assertEquals(4, value.intValue()); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : byte {", - " left as byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to byte"); - } - - @Test - public void as_short() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : short {", - " left as short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to Short"); - } - - @Test - public void as_int() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : int {", - " left as int", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to int"); - } - - @Test - public void as_long() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : long {", - " left as long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to long"); - } - - @Test - public void as_float() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : float {", - " left as float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to float"); - } - - @Test - public void as_double() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : double {", - " left as double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to double"); - } - - @Test - public void as_Byte() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : Byte {", - " left as Byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to byte"); - } - - @Test - public void as_Short() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : Short {", - " left as Short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to Short"); - } - - @Test - public void as_Integer() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : Integer {", - " left as Integer", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to Integer"); - } - - @Test - public void as_Long() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : Long {", - " left as Long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to Long"); - } - - @Test - public void as_Float() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : Float {", - " left as Float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to Float"); - } - - @Test - public void as_Double() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : Double {", - " left as Double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to Double"); - } - - @Test - public void as_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public AtomicInteger fct(final AtomicInteger left) {", - " return ((AtomicInteger) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicInteger) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicInteger to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : AtomicInteger) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final AtomicInteger left) {", - " return ((Number) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/AtomicLongCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/AtomicLongCastExtensionsTest.java deleted file mode 100644 index c375e30695..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/AtomicLongCastExtensionsTest.java +++ /dev/null @@ -1,386 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toByte; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toDouble; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toFloat; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toInt; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toLong; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toLongInteger; -import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toShort; - -import java.util.concurrent.atomic.AtomicLong; - -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - AtomicLongCastExtensionsTest.Code.class, - AtomicLongCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class AtomicLongCastExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static AtomicLong left = new AtomicLong(4); - - @Test - public void toFloat_AtomicLong() { - assertEpsilonEquals(4, toFloat(left)); - } - - @Test - public void toByte_AtomicLong() { - assertEquals(4, toByte(left)); - } - - @Test - public void toLong_AtomicLong() { - assertEquals(4, toLong(left)); - } - - @Test - public void toDouble_AtomicLong() { - assertEpsilonEquals(4, toDouble(left)); - } - - @Test - public void toShort_AtomicLong() { - assertEquals(4, toShort(left)); - } - - @Test - public void toInt_AtomicLong() { - assertEquals(4, toInt(left)); - } - - @Test - public void toIntegerInteger_AtomicLong() { - Long value = toLongInteger(left); - assertNotNull(value); - assertEquals(4, value.longValue()); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : byte {", - " left as byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to byte"); - } - - @Test - public void as_short() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : short {", - " left as short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to Short"); - } - - @Test - public void as_int() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : int {", - " left as int", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to int"); - } - - @Test - public void as_long() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : AtomicLong) : long {", - " left as long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to long"); - } - - @Test - public void as_float() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : float {", - " left as float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to float"); - } - - @Test - public void as_double() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : double {", - " left as double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to double"); - } - - @Test - public void as_Byte() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : Byte {", - " left as Byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to byte"); - } - - @Test - public void as_Short() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : Short {", - " left as Short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to Short"); - } - - @Test - public void as_Integer() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : Integer {", - " left as Integer", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to Integer"); - } - - @Test - public void as_Long() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : Long {", - " left as Long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to Long"); - } - - @Test - public void as_Float() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : Float {", - " left as Float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to Float"); - } - - @Test - public void as_Double() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : Double {", - " left as Double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to Double"); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : AtomicLong {", - " left as AtomicLong", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public AtomicLong fct(final AtomicLong left) {", - " return ((AtomicLong) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from AtomicLong to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : AtomicLong) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final AtomicLong left) {", - " return ((Number) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/ByteCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/ByteCastExtensionsTest.java deleted file mode 100644 index 4089045914..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/ByteCastExtensionsTest.java +++ /dev/null @@ -1,421 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - ByteCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class ByteCastExtensionsTest { - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte) : byte {", - " left as byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public byte fct(final Byte left) {", - " return ((byte) (left).byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte) : short {", - " left as short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public short fct(final Byte left) {", - " return ((short) (left).byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte) : int {", - " left as int", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left) {", - " return ((int) (left).byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte) : long {", - " left as long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Byte left) {", - " return ((long) (left).byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte) : float {", - " left as float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Byte left) {", - " return ((float) (left).byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte) : double {", - " left as double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Byte left) {", - " return ((double) (left).byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte) : Byte {", - " left as Byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Byte fct(final Byte left) {", - " return ((Byte) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Short() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Byte) : Short {", - " left as Short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to Short"); - } - - @Test - public void as_Integer() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Byte) : Integer {", - " left as Integer", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to Integer"); - } - - @Test - public void as_Long() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Byte) : Long {", - " left as Long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to Long"); - } - - @Test - public void as_Float() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Byte) : Float {", - " left as Float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to Float"); - } - - @Test - public void as_Double() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Byte) : Double {", - " left as Double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to Double"); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Byte) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Byte) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final Byte left) {", - " return ((Number) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/DoubleCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/DoubleCastExtensionsTest.java deleted file mode 100644 index dba05de7a8..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/DoubleCastExtensionsTest.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - DoubleCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class DoubleCastExtensionsTest { - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Double) : byte {", - " left as byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Double or double to byte"); - } - - @Test - public void as_short() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Double) : short {", - " left as short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Double or double to Short"); - } - - @Test - public void as_int() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Double) : int {", - " left as int", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Double or double to int"); - } - - @Test - public void as_long() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Double) : long {", - " left as long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Double or double to long"); - } - - @Test - public void as_float() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Double) : float {", - " left as float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Double or double to float"); - } - - @Test - public void as_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double) : double {", - " left as double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Double left) {", - " return ((double) (left).doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Byte() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Double) : Byte {", - " left as Byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Double or double to byte"); - } - - @Test - public void as_Short() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Double) : Short {", - " left as Short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Double or double to Short"); - } - - @Test - public void as_Integer() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Double) : Integer {", - " left as Integer", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Double or double to Integer"); - } - - @Test - public void as_Long() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Double) : Long {", - " left as Long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Double or double to Long"); - } - - @Test - public void as_Float() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Double) : Float {", - " left as Float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Double or double to Float"); - } - - @Test - public void as_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double) : Double {", - " left as Double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Double fct(final Double left) {", - " return ((Double) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Double) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Double or double to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Double) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Double or double to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Double or double to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final Double left) {", - " return ((Number) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/FloatCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/FloatCastExtensionsTest.java deleted file mode 100644 index b4b6784999..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/FloatCastExtensionsTest.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - FloatCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class FloatCastExtensionsTest { - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Float) : byte {", - " left as byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Float or float to byte"); - } - - @Test - public void as_short() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Float) : short {", - " left as short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Float or float to Short"); - } - - @Test - public void as_int() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Float) : int {", - " left as int", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Float or float to int"); - } - - @Test - public void as_long() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Float) : long {", - " left as long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Float or float to long"); - } - - @Test - public void as_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float) : float {", - " left as float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Float left) {", - " return ((float) (left).floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float) : double {", - " left as double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Float left) {", - " return ((double) (left).floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Byte() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Float) : Byte {", - " left as Byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Float or float to byte"); - } - - @Test - public void as_Short() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Float) : Short {", - " left as Short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Float or float to Short"); - } - - @Test - public void as_Integer() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Float) : Integer {", - " left as Integer", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Float or float to Integer"); - } - - @Test - public void as_Long() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Float) : Long {", - " left as Long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Float or float to Long"); - } - - @Test - public void as_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float) : Float {", - " left as Float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Float fct(final Float left) {", - " return ((Float) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Double() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Float) : Double {", - " left as Double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Float or float to Double"); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Float) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Float or float to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Float) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Float or float to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Float or float to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final Float left) {", - " return ((Number) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/IntegerCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/IntegerCastExtensionsTest.java deleted file mode 100644 index 741f80e60e..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/IntegerCastExtensionsTest.java +++ /dev/null @@ -1,385 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - IntegerCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class IntegerCastExtensionsTest { - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Integer) : byte {", - " left as byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Integer or int to byte"); - } - - @Test - public void as_short() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Integer) : short {", - " left as short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Integer or int to Short"); - } - - @Test - public void as_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer) : int {", - " left as int", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left) {", - " return ((int) (left).intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer) : long {", - " left as long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Integer left) {", - " return ((long) (left).intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer) : float {", - " left as float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Integer left) {", - " return ((float) (left).intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer) : double {", - " left as double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Integer left) {", - " return ((double) (left).intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Byte() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Integer) : Byte {", - " left as Byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Integer or int to byte"); - } - - @Test - public void as_Short() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Integer) : Short {", - " left as Short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Integer or int to Short"); - } - - @Test - public void as_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer) : Integer {", - " left as Integer", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Integer fct(final Integer left) {", - " return ((Integer) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Long() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Integer) : Long {", - " left as Long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Integer or int to Long"); - } - - @Test - public void as_Float() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Integer) : Float {", - " left as Float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Integer or int to Float"); - } - - @Test - public void as_Double() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Integer) : Double {", - " left as Double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Integer or int to Double"); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Integer) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Integer or int to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Integer) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Integer or int to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Integer or int to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final Integer left) {", - " return ((Number) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/LongCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/LongCastExtensionsTest.java deleted file mode 100644 index 08cdd0b018..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/LongCastExtensionsTest.java +++ /dev/null @@ -1,367 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - LongCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class LongCastExtensionsTest { - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Long) : byte {", - " left as byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Long or long to byte"); - } - - @Test - public void as_short() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Long) : short {", - " left as short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Long or long to Short"); - } - - @Test - public void as_int() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Long) : int {", - " left as int", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Long or long to int"); - } - - @Test - public void as_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long) : long {", - " left as long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Long left) {", - " return ((long) (left).longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long) : float {", - " left as float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Long left) {", - " return ((float) (left).longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long) : double {", - " left as double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Long left) {", - " return ((double) (left).longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Byte() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Long) : Byte {", - " left as Byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Long or long to byte"); - } - - @Test - public void as_Short() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Long) : Short {", - " left as Short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Long or long to Short"); - } - - @Test - public void as_Integer() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Long) : Integer {", - " left as Integer", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Long or long to Integer"); - } - - @Test - public void as_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long) : Long {", - " left as Long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Long fct(final Long left) {", - " return ((Long) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Float() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Long) : Float {", - " left as Float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Long or long to Float"); - } - - @Test - public void as_Double() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Long) : Double {", - " left as Double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Long or long to Double"); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Long) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Long or long to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Long) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Long or long to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Long or long to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final Long left) {", - " return ((Number) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/NumberCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/NumberCastExtensionsTest.java deleted file mode 100644 index 640f38f139..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/NumberCastExtensionsTest.java +++ /dev/null @@ -1,500 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import static io.sarl.lang.scoping.extensions.numbers.cast.NumberCastExtensions.*; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.lib.Inline; -import org.eclipse.xtext.xbase.lib.Pure; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - NumberCastExtensionsTest.Code.class, - NumberCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class NumberCastExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Number left = new AtomicDouble(4); - - @Test - public void toAtomicLong_Number() { - AtomicLong value = toAtomicLong(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicInteger_Number() { - AtomicInteger value = toAtomicInteger(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicDouble_Number() { - AtomicDouble value = toAtomicDouble(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Number) : byte {", - " left as byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Number to byte"); - } - - @Test - public void as_short() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Number) : short {", - " left as short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Number to Short"); - } - - @Test - public void as_int() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Number) : int {", - " left as int", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Number to int"); - } - - @Test - public void as_long() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Number) : long {", - " left as long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Number to long"); - } - - @Test - public void as_float() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Number) : float {", - " left as float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Number to float"); - } - - @Test - public void as_double() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Number) : double {", - " left as double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from Number to double"); - } - - @Test - public void as_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number) : Byte {", - " left as Byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Byte fct(final Number left) {", - " return ((Byte) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number) : Short {", - " left as Short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Short fct(final Number left) {", - " return ((Short) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number) : Integer {", - " left as Integer", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Integer fct(final Number left) {", - " return ((Integer) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number) : Long {", - " left as Long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Long fct(final Number left) {", - " return ((Long) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number) : Float {", - " left as Float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Float fct(final Number left) {", - " return ((Float) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number) : Double {", - " left as Double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Double fct(final Number left) {", - " return ((Double) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Number) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public AtomicInteger fct(final Number left) {", - " return ((AtomicInteger) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Number) : AtomicLong {", - " left as AtomicLong", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public AtomicLong fct(final Number left) {", - " return ((AtomicLong) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_AtomicDouble() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number) : AtomicDouble {", - " left as AtomicDouble", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public AtomicDouble fct(final Number left) {", - " return ((AtomicDouble) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final Number left) {", - " return ((Number) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveByteCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveByteCastExtensionsTest.java deleted file mode 100644 index bf9a2bd41c..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveByteCastExtensionsTest.java +++ /dev/null @@ -1,460 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveByteCastExtensions.toAtomicDouble; -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveByteCastExtensions.toAtomicInteger; -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveByteCastExtensions.toAtomicLong; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveByteCastExtensionsTest.Code.class, - PrimitiveByteCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveByteCastExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static byte left = 4; - - @Test - public void toAtomicLong_byte() { - AtomicLong value = toAtomicLong(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicInteger_byte() { - AtomicInteger value = toAtomicInteger(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicDouble_byte() { - AtomicDouble value = toAtomicDouble(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte) : byte {", - " left as byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public byte fct(final byte left) {", - " return ((byte) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte) : short {", - " left as short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public short fct(final byte left) {", - " return ((short) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte) : int {", - " left as int", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left) {", - " return ((int) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte) : long {", - " left as long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final byte left) {", - " return ((long) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte) : float {", - " left as float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final byte left) {", - " return ((float) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte) : double {", - " left as double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final byte left) {", - " return ((double) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte) : Byte {", - " left as Byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Byte fct(final byte left) {", - " return ((Byte) Byte.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Short() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : byte) : Short {", - " left as Short", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to Short"); - } - - @Test - public void as_Integer() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : byte) : Integer {", - " left as Integer", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to Integer"); - } - - @Test - public void as_Long() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : byte) : Long {", - " left as Long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to Long"); - } - - @Test - public void as_Float() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : byte) : Float {", - " left as Float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to Float"); - } - - @Test - public void as_Double() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : byte) : Double {", - " left as Double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to Double"); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : byte) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : byte) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from byte or Byte to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final byte left) {", - " return ((Number) Byte.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveDoubleCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveDoubleCastExtensionsTest.java deleted file mode 100644 index 1e751f150d..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveDoubleCastExtensionsTest.java +++ /dev/null @@ -1,555 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveDoubleCastExtensions.toAtomicDouble; -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveDoubleCastExtensions.toAtomicInteger; -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveDoubleCastExtensions.toAtomicLong; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveDoubleCastExtensionsTest.Code.class, - PrimitiveDoubleCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveDoubleCastExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static double left = 4; - - @Test - public void toAtomicLong_double() { - AtomicLong value = toAtomicLong(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicInteger_double() { - AtomicInteger value = toAtomicInteger(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicDouble_double() { - AtomicDouble value = toAtomicDouble(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double) : byte {", - " left as byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public byte fct(final double left) {", - " return ((byte) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double) : short {", - " left as short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public short fct(final double left) {", - " return ((short) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double) : int {", - " left as int", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left) {", - " return ((int) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double) : long {", - " left as long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final double left) {", - " return ((long) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double) : float {", - " left as float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final double left) {", - " return ((float) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double) : double {", - " left as double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final double left) {", - " return ((double) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Byte() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double) : Byte {", - " left as Byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Byte fct(final double left) {", - " return ((Byte) Double.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Short() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double) : Short {", - " left as Short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Short fct(final double left) {", - " return ((Short) Double.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Integer() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double) : Integer {", - " left as Integer", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Integer fct(final double left) {", - " return ((Integer) Double.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Long() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double) : Long {", - " left as Long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Long fct(final double left) {", - " return ((Long) Double.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Float() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double) : Float {", - " left as Float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Float fct(final double left) {", - " return ((Float) Double.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double) : Double {", - " left as Double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Double fct(final double left) {", - " return ((Double) Double.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : double) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from double or Double to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : double) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from double or Double to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from double or Double to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final double left) {", - " return ((Number) Double.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveFloatCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveFloatCastExtensionsTest.java deleted file mode 100644 index 8913924269..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveFloatCastExtensionsTest.java +++ /dev/null @@ -1,536 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveFloatCastExtensions.toAtomicDouble; -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveFloatCastExtensions.toAtomicInteger; -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveFloatCastExtensions.toAtomicLong; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveFloatCastExtensionsTest.Code.class, - PrimitiveFloatCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveFloatCastExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static float left = 4; - - @Test - public void toAtomicLong_float() { - AtomicLong value = toAtomicLong(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicInteger_float() { - AtomicInteger value = toAtomicInteger(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicDouble_float() { - AtomicDouble value = toAtomicDouble(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float) : byte {", - " left as byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public byte fct(final float left) {", - " return ((byte) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float) : short {", - " left as short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public short fct(final float left) {", - " return ((short) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float) : int {", - " left as int", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left) {", - " return ((int) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float) : long {", - " left as long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final float left) {", - " return ((long) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float) : float {", - " left as float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final float left) {", - " return ((float) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float) : double {", - " left as double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final float left) {", - " return ((double) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Byte() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float) : Byte {", - " left as Byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Byte fct(final float left) {", - " return ((Byte) Float.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Short() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float) : Short {", - " left as Short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Short fct(final float left) {", - " return ((Short) Float.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Integer() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float) : Integer {", - " left as Integer", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Integer fct(final float left) {", - " return ((Integer) Float.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Long() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float) : Long {", - " left as Long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Long fct(final float left) {", - " return ((Long) Float.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float) : Float {", - " left as Float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Float fct(final float left) {", - " return ((Float) Float.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Double() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : float) : Double {", - " left as Double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from float or Float to Double"); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : float) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from float or Float to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : float) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from float or Float to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from float or Float to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final float left) {", - " return ((Number) Float.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveIntCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveIntCastExtensionsTest.java deleted file mode 100644 index b9ab645f73..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveIntCastExtensionsTest.java +++ /dev/null @@ -1,498 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveIntCastExtensions.toAtomicDouble; -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveIntCastExtensions.toAtomicInteger; -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveIntCastExtensions.toAtomicLong; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveIntCastExtensionsTest.Code.class, - PrimitiveIntCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveIntCastExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static int left = 4; - - @Test - public void toAtomicLong_int() { - AtomicLong value = toAtomicLong(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicInteger_int() { - AtomicInteger value = toAtomicInteger(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicDouble_int() { - AtomicDouble value = toAtomicDouble(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int) : byte {", - " left as byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public byte fct(final int left) {", - " return ((byte) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int) : short {", - " left as short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public short fct(final int left) {", - " return ((short) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int) : int {", - " left as int", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left) {", - " return ((int) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int) : long {", - " left as long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final int left) {", - " return ((long) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int) : float {", - " left as float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final int left) {", - " return ((float) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int) : double {", - " left as double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final int left) {", - " return ((double) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Byte() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int) : Byte {", - " left as Byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Byte fct(final int left) {", - " return ((Byte) Integer.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Short() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int) : Short {", - " left as Short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Short fct(final int left) {", - " return ((Short) Integer.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int) : Integer {", - " left as Integer", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Integer fct(final int left) {", - " return ((Integer) Integer.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Long() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : int) : Long {", - " left as Long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from int or Integer to Long"); - } - - @Test - public void as_Float() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : int) : Float {", - " left as Float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from int or Integer to Float"); - } - - @Test - public void as_Double() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : int) : Double {", - " left as Double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from int or Integer to Double"); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : int) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from int or Integer to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : int) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from int or Integer to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from int or Integer to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final int left) {", - " return ((Number) Integer.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveLongCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveLongCastExtensionsTest.java deleted file mode 100644 index ea0b22d722..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveLongCastExtensionsTest.java +++ /dev/null @@ -1,517 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveLongCastExtensions.toAtomicDouble; -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveLongCastExtensions.toAtomicInteger; -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveLongCastExtensions.toAtomicLong; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveLongCastExtensionsTest.Code.class, - PrimitiveLongCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveLongCastExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static long left = 4; - - @Test - public void toAtomicLong_long() { - AtomicLong value = toAtomicLong(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicInteger_long() { - AtomicInteger value = toAtomicInteger(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicDouble_long() { - AtomicDouble value = toAtomicDouble(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long) : byte {", - " left as byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public byte fct(final long left) {", - " return ((byte) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long) : short {", - " left as short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public short fct(final long left) {", - " return ((short) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long) : int {", - " left as int", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final long left) {", - " return ((int) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long) : long {", - " left as long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final long left) {", - " return ((long) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long) : float {", - " left as float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final long left) {", - " return ((float) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long) : double {", - " left as double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final long left) {", - " return ((double) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Byte() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long) : Byte {", - " left as Byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Byte fct(final long left) {", - " return ((Byte) Long.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Short() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long) : Short {", - " left as Short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Short fct(final long left) {", - " return ((Short) Long.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Integer() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long) : Integer {", - " left as Integer", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Integer fct(final long left) {", - " return ((Integer) Long.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long) : Long {", - " left as Long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Long fct(final long left) {", - " return ((Long) Long.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Float() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : long) : Float {", - " left as Float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from long or Long to Float"); - } - - @Test - public void as_Double() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : long) : Double {", - " left as Double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from long or Long to Double"); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : long) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from long or Long to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : long) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from long or Long to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : long) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from long or Long to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : long) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final long left) {", - " return ((Number) Long.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveShortCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveShortCastExtensionsTest.java deleted file mode 100644 index 62d4038863..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/PrimitiveShortCastExtensionsTest.java +++ /dev/null @@ -1,479 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveShortCastExtensions.toAtomicDouble; -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveShortCastExtensions.toAtomicInteger; -import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveShortCastExtensions.toAtomicLong; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveShortCastExtensionsTest.Code.class, - PrimitiveShortCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveShortCastExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static short left = 4; - - @Test - public void toAtomicLong_short() { - AtomicLong value = toAtomicLong(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicInteger_short() { - AtomicInteger value = toAtomicInteger(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - @Test - public void toAtomicDouble_short() { - AtomicDouble value = toAtomicDouble(left); - assertNotNull(value); - assertEpsilonEquals(4., value.doubleValue()); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short) : byte {", - " left as byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public byte fct(final short left) {", - " return ((byte) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short) : short {", - " left as short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public short fct(final short left) {", - " return ((short) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short) : int {", - " left as int", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left) {", - " return ((int) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short) : long {", - " left as long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final short left) {", - " return ((long) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short) : float {", - " left as float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final short left) {", - " return ((float) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short) : double {", - " left as double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final short left) {", - " return ((double) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Byte() throws Exception { - // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short) : Byte {", - " left as Byte", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Byte fct(final short left) {", - " return ((Byte) Short.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short) : Short {", - " left as Short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Short fct(final short left) {", - " return ((Short) Short.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Integer() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : short) : Integer {", - " left as Integer", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to Integer"); - } - - @Test - public void as_Long() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : short) : Long {", - " left as Long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to Long"); - } - - @Test - public void as_Float() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : short) : Float {", - " left as Float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to Float"); - } - - @Test - public void as_Double() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : short) : Double {", - " left as Double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to Double"); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final short left) {", - " return ((Number) Short.valueOf(left));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/ShortCastExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/ShortCastExtensionsTest.java deleted file mode 100644 index 516d16aca6..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/ShortCastExtensionsTest.java +++ /dev/null @@ -1,403 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.cast; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.common.types.TypesPackage; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.eclipse.xtext.xbase.validation.IssueCodes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - ShortCastExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class ShortCastExtensionsTest { - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void as_byte() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Short) : byte {", - " left as byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to byte"); - } - - @Test - public void as_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short) : short {", - " left as short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public short fct(final Short left) {", - " return ((short) (left).shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short) : int {", - " left as int", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left) {", - " return ((int) (left).shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short) : long {", - " left as long", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public long fct(final Short left) {", - " return ((long) (left).shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short) : float {", - " left as float", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public float fct(final Short left) {", - " return ((float) (left).shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short) : double {", - " left as double", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public double fct(final Short left) {", - " return ((double) (left).shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Byte() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Short) : Byte {", - " left as Byte", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to byte"); - } - - @Test - public void as_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short) : Short {", - " left as Short", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Short fct(final Short left) {", - " return ((Short) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void as_Integer() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Short) : Integer {", - " left as Integer", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to Integer"); - } - - @Test - public void as_Long() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Short) : Long {", - " left as Long", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to Long"); - } - - @Test - public void as_Float() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Short) : Float {", - " left as Float", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to Float"); - } - - @Test - public void as_Double() throws Exception { - validate(file(multilineString( - "class A {", - " def fct(left : Short) : Double {", - " left as Double", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to Double"); - } - - @Test - public void as_AtomicInteger() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Short) : AtomicInteger {", - " left as AtomicInteger", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to AtomicInteger"); - } - - @Test - public void as_AtomicLong() throws Exception { - validate(file(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Short) : AtomicLong {", - " left as AtomicLong", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to AtomicLong"); - } - - @Test - public void as_AtomicDouble() throws Exception { - validate(file(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short) : AtomicLong {", - " left as AtomicDouble", - " }", - "}"))).assertError( - TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), - IssueCodes.INVALID_CAST, - "Cannot cast from short or Short to AtomicDouble"); - } - - @Test - public void as_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short) : Number {", - " left as Number", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public Number fct(final Short left) {", - " return ((Number) left);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomicdouble/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomicdouble/CodeTest.java new file mode 100644 index 0000000000..eb1b75180f --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomicdouble/CodeTest.java @@ -0,0 +1,86 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.atomicdouble; + +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toByte; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toDouble; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toDoubleObject; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toFloat; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toInt; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toLong; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicDoubleCastExtensions.toShort; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static AtomicDouble left = new AtomicDouble(4); + + @Test + public void toFloat_AtomicLong() { + assertEpsilonEquals(4, toFloat(left)); + } + + @Test + public void toByte_AtomicLong() { + assertEquals(4, toByte(left)); + } + + @Test + public void toLong_AtomicLong() { + assertEquals(4, toLong(left)); + } + + @Test + public void toDouble_AtomicLong() { + assertEpsilonEquals(4, toDouble(left)); + } + + @Test + public void toShort_AtomicLong() { + assertEquals(4, toShort(left)); + } + + @Test + public void toInt_AtomicLong() { + assertEquals(4, toInt(left)); + } + + @Test + public void toIntegerInteger_AtomicLong() { + Double value = toDoubleObject(left); + assertNotNull(value); + assertEpsilonEquals(4, value.doubleValue()); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomicdouble/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomicdouble/CompilerTest.java new file mode 100644 index 0000000000..3fc533a144 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomicdouble/CompilerTest.java @@ -0,0 +1,261 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.atomicdouble; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : byte {", + " left as byte", + " }", + "}")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : short {", + " left as short", + " }", + "}")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : int {", + " left as int", + " }", + "}")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : long {", + " left as long", + " }", + "}")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : float {", + " left as float", + " }", + "}")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : double {", + " left as double", + " }", + "}")); + } + + @DifferedTest + public void as_Byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : Byte {", + " left as Byte", + " }", + "}")); + } + + @DifferedTest + public void as_Short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : Short {", + " left as Short", + " }", + "}")); + } + + @DifferedTest + public void as_Integer() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : Integer {", + " left as Integer", + " }", + "}")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : Long {", + " left as Long", + " }", + "}")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : Float {", + " left as Float", + " }", + "}")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : Double {", + " left as Double", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicDouble) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicInteger", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicDouble) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : AtomicDouble {", + " left as AtomicDouble", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public AtomicDouble fct(final AtomicDouble left) {", + " return ((AtomicDouble) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : AtomicDouble) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final AtomicDouble left) {", + " return ((Number) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomicinteger/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomicinteger/CodeTest.java new file mode 100644 index 0000000000..1c6c63b057 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomicinteger/CodeTest.java @@ -0,0 +1,87 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.atomicinteger; + +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toByte; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toDouble; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toFloat; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toInt; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toInteger; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toLong; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicIntegerCastExtensions.toShort; + +import java.util.concurrent.atomic.AtomicInteger; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static AtomicInteger left = new AtomicInteger(4); + + @Test + public void toFloat_AtomicInteger() { + assertEpsilonEquals(4, toFloat(left)); + } + + @Test + public void toByte_AtomicInteger() { + assertEquals(4, toByte(left)); + } + + @Test + public void toLong_AtomicInteger() { + assertEquals(4, toLong(left)); + } + + @Test + public void toDouble_AtomicInteger() { + assertEpsilonEquals(4, toDouble(left)); + } + + @Test + public void toShort_AtomicInteger() { + assertEquals(4, toShort(left)); + } + + @Test + public void toInt_AtomicInteger() { + assertEquals(4, toInt(left)); + } + + @Test + public void toInteger_AtomicInteger() { + Integer value = toInteger(left); + assertNotNull(value); + assertEquals(4, value.intValue()); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomicinteger/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomicinteger/CompilerTest.java new file mode 100644 index 0000000000..a223c5fe0f --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomicinteger/CompilerTest.java @@ -0,0 +1,260 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.atomicinteger; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : byte {", + " left as byte", + " }", + "}")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : short {", + " left as short", + " }", + "}")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : int {", + " left as int", + " }", + "}")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : long {", + " left as long", + " }", + "}")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : float {", + " left as float", + " }", + "}")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : double {", + " left as double", + " }", + "}")); + } + + @DifferedTest + public void as_Byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : Byte {", + " left as Byte", + " }", + "}")); + } + + @DifferedTest + public void as_Short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : Short {", + " left as Short", + " }", + "}")); + } + + @DifferedTest + public void as_Integer() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : Integer {", + " left as Integer", + " }", + "}")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : Long {", + " left as Long", + " }", + "}")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : Float {", + " left as Float", + " }", + "}")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : Double {", + " left as Double", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public AtomicInteger fct(final AtomicInteger left) {", + " return ((AtomicInteger) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicInteger) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : AtomicInteger) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final AtomicInteger left) {", + " return ((Number) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomiclong/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomiclong/CodeTest.java new file mode 100644 index 0000000000..255c10c06b --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomiclong/CodeTest.java @@ -0,0 +1,87 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.atomiclong; + +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toByte; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toDouble; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toFloat; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toInt; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toLong; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toLongInteger; +import static io.sarl.lang.scoping.extensions.numbers.cast.AtomicLongCastExtensions.toShort; + +import java.util.concurrent.atomic.AtomicLong; + +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static AtomicLong left = new AtomicLong(4); + + @Test + public void toFloat_AtomicLong() { + assertEpsilonEquals(4, toFloat(left)); + } + + @Test + public void toByte_AtomicLong() { + assertEquals(4, toByte(left)); + } + + @Test + public void toLong_AtomicLong() { + assertEquals(4, toLong(left)); + } + + @Test + public void toDouble_AtomicLong() { + assertEpsilonEquals(4, toDouble(left)); + } + + @Test + public void toShort_AtomicLong() { + assertEquals(4, toShort(left)); + } + + @Test + public void toInt_AtomicLong() { + assertEquals(4, toInt(left)); + } + + @Test + public void toIntegerInteger_AtomicLong() { + Long value = toLongInteger(left); + assertNotNull(value); + assertEquals(4, value.longValue()); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomiclong/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomiclong/CompilerTest.java new file mode 100644 index 0000000000..23a3565476 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/atomiclong/CompilerTest.java @@ -0,0 +1,259 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.atomiclong; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : byte {", + " left as byte", + " }", + "}")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : short {", + " left as short", + " }", + "}")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : int {", + " left as int", + " }", + "}")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : AtomicLong) : long {", + " left as long", + " }", + "}")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : float {", + " left as float", + " }", + "}")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : double {", + " left as double", + " }", + "}")); + } + + @DifferedTest + public void as_Byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : Byte {", + " left as Byte", + " }", + "}")); + } + + @DifferedTest + public void as_Short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : Short {", + " left as Short", + " }", + "}")); + } + + @DifferedTest + public void as_Integer() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : Integer {", + " left as Integer", + " }", + "}")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : Long {", + " left as Long", + " }", + "}")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : Float {", + " left as Float", + " }", + "}")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : Double {", + " left as Double", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : AtomicLong {", + " left as AtomicLong", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public AtomicLong fct(final AtomicLong left) {", + " return ((AtomicLong) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : AtomicLong) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final AtomicLong left) {", + " return ((Number) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/byteobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/byteobject/CompilerTest.java new file mode 100644 index 0000000000..98da3c2f97 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/byteobject/CompilerTest.java @@ -0,0 +1,369 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.byteobject; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte) : byte {", + " left as byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public byte fct(final Byte left) {", + " return ((byte) (left).byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte) : short {", + " left as short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public short fct(final Byte left) {", + " return ((short) (left).byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte) : int {", + " left as int", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left) {", + " return ((int) (left).byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte) : long {", + " left as long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Byte left) {", + " return ((long) (left).byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte) : float {", + " left as float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Byte left) {", + " return ((float) (left).byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte) : double {", + " left as double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Byte left) {", + " return ((double) (left).byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte) : Byte {", + " left as Byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Byte fct(final Byte left) {", + " return ((Byte) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Byte) : Short {", + " left as Short", + " }", + "}")); + } + + @DifferedTest + public void as_Integer() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Byte) : Integer {", + " left as Integer", + " }", + "}")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Byte) : Long {", + " left as Long", + " }", + "}")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Byte) : Float {", + " left as Float", + " }", + "}")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Byte) : Double {", + " left as Double", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Byte) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Byte) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final Byte left) {", + " return ((Number) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/byteprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/byteprimitive/CodeTest.java new file mode 100644 index 0000000000..4c9ed1155c --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/byteprimitive/CodeTest.java @@ -0,0 +1,69 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.byteprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveByteCastExtensions.toAtomicDouble; +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveByteCastExtensions.toAtomicInteger; +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveByteCastExtensions.toAtomicLong; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static byte left = 4; + + @Test + public void toAtomicLong_byte() { + AtomicLong value = toAtomicLong(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicInteger_byte() { + AtomicInteger value = toAtomicInteger(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicDouble_byte() { + AtomicDouble value = toAtomicDouble(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/byteprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/byteprimitive/CompilerTest.java new file mode 100644 index 0000000000..237f956909 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/byteprimitive/CompilerTest.java @@ -0,0 +1,369 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.byteprimitive; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte) : byte {", + " left as byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public byte fct(final byte left) {", + " return ((byte) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte) : short {", + " left as short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public short fct(final byte left) {", + " return ((short) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte) : int {", + " left as int", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left) {", + " return ((int) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte) : long {", + " left as long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final byte left) {", + " return ((long) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte) : float {", + " left as float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final byte left) {", + " return ((float) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte) : double {", + " left as double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final byte left) {", + " return ((double) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte) : Byte {", + " left as Byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Byte fct(final byte left) {", + " return ((Byte) Byte.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : byte) : Short {", + " left as Short", + " }", + "}")); + } + + @DifferedTest + public void as_Integer() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : byte) : Integer {", + " left as Integer", + " }", + "}")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : byte) : Long {", + " left as Long", + " }", + "}")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : byte) : Float {", + " left as Float", + " }", + "}")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : byte) : Double {", + " left as Double", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : byte) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : byte) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final byte left) {", + " return ((Number) Byte.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/doubleobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/doubleobject/CompilerTest.java new file mode 100644 index 0000000000..0a05200fdc --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/doubleobject/CompilerTest.java @@ -0,0 +1,264 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.doubleobject; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Double) : byte {", + " left as byte", + " }", + "}")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Double) : short {", + " left as short", + " }", + "}")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Double) : int {", + " left as int", + " }", + "}")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Double) : long {", + " left as long", + " }", + "}")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Double) : float {", + " left as float", + " }", + "}")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double) : double {", + " left as double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Double left) {", + " return ((double) (left).doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Double) : Byte {", + " left as Byte", + " }", + "}")); + } + + @DifferedTest + public void as_Short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Double) : Short {", + " left as Short", + " }", + "}")); + } + + @DifferedTest + public void as_Integer() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Double) : Integer {", + " left as Integer", + " }", + "}")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Double) : Long {", + " left as Long", + " }", + "}")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Double) : Float {", + " left as Float", + " }", + "}")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double) : Double {", + " left as Double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Double fct(final Double left) {", + " return ((Double) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Double) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Double) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final Double left) {", + " return ((Number) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/doubleprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/doubleprimitive/CodeTest.java new file mode 100644 index 0000000000..fbb61d611f --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/doubleprimitive/CodeTest.java @@ -0,0 +1,69 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.doubleprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveDoubleCastExtensions.toAtomicDouble; +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveDoubleCastExtensions.toAtomicInteger; +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveDoubleCastExtensions.toAtomicLong; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static double left = 4; + + @Test + public void toAtomicLong_double() { + AtomicLong value = toAtomicLong(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicInteger_double() { + AtomicInteger value = toAtomicInteger(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicDouble_double() { + AtomicDouble value = toAtomicDouble(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/doubleprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/doubleprimitive/CompilerTest.java new file mode 100644 index 0000000000..0ca14b7897 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/doubleprimitive/CompilerTest.java @@ -0,0 +1,482 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.doubleprimitive; + +import org.eclipse.xtext.common.types.TypesPackage; +import org.eclipse.xtext.xbase.validation.IssueCodes; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double) : byte {", + " left as byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public byte fct(final double left) {", + " return ((byte) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double) : short {", + " left as short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public short fct(final double left) {", + " return ((short) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double) : int {", + " left as int", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left) {", + " return ((int) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double) : long {", + " left as long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final double left) {", + " return ((long) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double) : float {", + " left as float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final double left) {", + " return ((float) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double) : double {", + " left as double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final double left) {", + " return ((double) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Byte() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double) : Byte {", + " left as Byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Byte fct(final double left) {", + " return ((Byte) Double.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Short() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double) : Short {", + " left as Short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Short fct(final double left) {", + " return ((Short) Double.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Integer() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double) : Integer {", + " left as Integer", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Integer fct(final double left) {", + " return ((Integer) Double.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Long() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double) : Long {", + " left as Long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Long fct(final double left) {", + " return ((Long) Double.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Float() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double) : Float {", + " left as Float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Float fct(final double left) {", + " return ((Float) Double.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double) : Double {", + " left as Double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Double fct(final double left) {", + " return ((Double) Double.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : double) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : double) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final double left) {", + " return ((Number) Double.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/floatobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/floatobject/CompilerTest.java new file mode 100644 index 0000000000..28bdf166b8 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/floatobject/CompilerTest.java @@ -0,0 +1,288 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.floatobject; + +import org.eclipse.xtext.common.types.TypesPackage; +import org.eclipse.xtext.xbase.validation.IssueCodes; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Float) : byte {", + " left as byte", + " }", + "}")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Float) : short {", + " left as short", + " }", + "}")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Float) : int {", + " left as int", + " }", + "}")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Float) : long {", + " left as long", + " }", + "}")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float) : float {", + " left as float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Float left) {", + " return ((float) (left).floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float) : double {", + " left as double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Float left) {", + " return ((double) (left).floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Float) : Byte {", + " left as Byte", + " }", + "}")); + } + + @DifferedTest + public void as_Short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Float) : Short {", + " left as Short", + " }", + "}")); + } + + @DifferedTest + public void as_Integer() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Float) : Integer {", + " left as Integer", + " }", + "}")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Float) : Long {", + " left as Long", + " }", + "}")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float) : Float {", + " left as Float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Float fct(final Float left) {", + " return ((Float) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Float) : Double {", + " left as Double", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Float) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Float) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final Float left) {", + " return ((Number) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/floatprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/floatprimitive/CodeTest.java new file mode 100644 index 0000000000..fd085f9d01 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/floatprimitive/CodeTest.java @@ -0,0 +1,69 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.floatprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveFloatCastExtensions.toAtomicDouble; +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveFloatCastExtensions.toAtomicInteger; +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveFloatCastExtensions.toAtomicLong; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static float left = 4; + + @Test + public void toAtomicLong_float() { + AtomicLong value = toAtomicLong(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicInteger_float() { + AtomicInteger value = toAtomicInteger(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicDouble_float() { + AtomicDouble value = toAtomicDouble(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/floatprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/floatprimitive/CompilerTest.java new file mode 100644 index 0000000000..77149de6c5 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/floatprimitive/CompilerTest.java @@ -0,0 +1,457 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.floatprimitive; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float) : byte {", + " left as byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public byte fct(final float left) {", + " return ((byte) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float) : short {", + " left as short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public short fct(final float left) {", + " return ((short) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float) : int {", + " left as int", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left) {", + " return ((int) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float) : long {", + " left as long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final float left) {", + " return ((long) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float) : float {", + " left as float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final float left) {", + " return ((float) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float) : double {", + " left as double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final float left) {", + " return ((double) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Byte() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float) : Byte {", + " left as Byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Byte fct(final float left) {", + " return ((Byte) Float.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Short() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float) : Short {", + " left as Short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Short fct(final float left) {", + " return ((Short) Float.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Integer() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float) : Integer {", + " left as Integer", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Integer fct(final float left) {", + " return ((Integer) Float.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Long() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float) : Long {", + " left as Long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Long fct(final float left) {", + " return ((Long) Float.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float) : Float {", + " left as Float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Float fct(final float left) {", + " return ((Float) Float.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : float) : Double {", + " left as Double", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : float) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : float) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final float left) {", + " return ((Number) Float.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/integerobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/integerobject/CompilerTest.java new file mode 100644 index 0000000000..a6c1fe17be --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/integerobject/CompilerTest.java @@ -0,0 +1,327 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.integerobject; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Integer) : byte {", + " left as byte", + " }", + "}")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Integer) : short {", + " left as short", + " }", + "}")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer) : int {", + " left as int", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left) {", + " return ((int) (left).intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer) : long {", + " left as long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Integer left) {", + " return ((long) (left).intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer) : float {", + " left as float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Integer left) {", + " return ((float) (left).intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer) : double {", + " left as double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Integer left) {", + " return ((double) (left).intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Integer) : Byte {", + " left as Byte", + " }", + "}")); + } + + @DifferedTest + public void as_Short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Integer) : Short {", + " left as Short", + " }", + "}")); + } + + @DifferedTest + public void as_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer) : Integer {", + " left as Integer", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Integer fct(final Integer left) {", + " return ((Integer) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Integer) : Long {", + " left as Long", + " }", + "}")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Integer) : Float {", + " left as Float", + " }", + "}")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Integer) : Double {", + " left as Double", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Integer) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Integer) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final Integer left) {", + " return ((Number) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/intprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/intprimitive/CodeTest.java new file mode 100644 index 0000000000..1d15cf90e1 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/intprimitive/CodeTest.java @@ -0,0 +1,69 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.intprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveIntCastExtensions.toAtomicDouble; +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveIntCastExtensions.toAtomicInteger; +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveIntCastExtensions.toAtomicLong; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static int left = 4; + + @Test + public void toAtomicLong_int() { + AtomicLong value = toAtomicLong(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicInteger_int() { + AtomicInteger value = toAtomicInteger(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicDouble_int() { + AtomicDouble value = toAtomicDouble(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/intprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/intprimitive/CompilerTest.java new file mode 100644 index 0000000000..8eb1ea81b4 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/intprimitive/CompilerTest.java @@ -0,0 +1,413 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.intprimitive; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int) : byte {", + " left as byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public byte fct(final int left) {", + " return ((byte) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int) : short {", + " left as short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public short fct(final int left) {", + " return ((short) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int) : int {", + " left as int", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left) {", + " return ((int) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int) : long {", + " left as long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final int left) {", + " return ((long) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int) : float {", + " left as float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final int left) {", + " return ((float) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int) : double {", + " left as double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final int left) {", + " return ((double) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Byte() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int) : Byte {", + " left as Byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Byte fct(final int left) {", + " return ((Byte) Integer.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Short() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int) : Short {", + " left as Short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Short fct(final int left) {", + " return ((Short) Integer.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int) : Integer {", + " left as Integer", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Integer fct(final int left) {", + " return ((Integer) Integer.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : int) : Long {", + " left as Long", + " }", + "}")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : int) : Float {", + " left as Float", + " }", + "}")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : int) : Double {", + " left as Double", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : int) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : int) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final int left) {", + " return ((Number) Integer.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/longobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/longobject/CompilerTest.java new file mode 100644 index 0000000000..63bacb37a6 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/longobject/CompilerTest.java @@ -0,0 +1,309 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.longobject; + +import org.eclipse.xtext.common.types.TypesPackage; +import org.eclipse.xtext.xbase.validation.IssueCodes; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Long) : byte {", + " left as byte", + " }", + "}")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Long) : short {", + " left as short", + " }", + "}")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Long) : int {", + " left as int", + " }", + "}")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long) : long {", + " left as long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Long left) {", + " return ((long) (left).longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long) : float {", + " left as float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Long left) {", + " return ((float) (left).longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long) : double {", + " left as double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Long left) {", + " return ((double) (left).longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Long) : Byte {", + " left as Byte", + " }", + "}")); + } + + @DifferedTest + public void as_Short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Long) : Short {", + " left as Short", + " }", + "}")); + } + + @DifferedTest + public void as_Integer() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Long) : Integer {", + " left as Integer", + " }", + "}")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long) : Long {", + " left as Long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Long fct(final Long left) {", + " return ((Long) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Long) : Float {", + " left as Float", + " }", + "}")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Long) : Double {", + " left as Double", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Long) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Long) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final Long left) {", + " return ((Number) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/longprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/longprimitive/CodeTest.java new file mode 100644 index 0000000000..6daf224266 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/longprimitive/CodeTest.java @@ -0,0 +1,69 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.longprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveLongCastExtensions.toAtomicDouble; +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveLongCastExtensions.toAtomicInteger; +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveLongCastExtensions.toAtomicLong; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static long left = 4; + + @Test + public void toAtomicLong_long() { + AtomicLong value = toAtomicLong(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicInteger_long() { + AtomicInteger value = toAtomicInteger(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicDouble_long() { + AtomicDouble value = toAtomicDouble(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/longprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/longprimitive/CompilerTest.java new file mode 100644 index 0000000000..e94b651c08 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/longprimitive/CompilerTest.java @@ -0,0 +1,435 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.longprimitive; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long) : byte {", + " left as byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public byte fct(final long left) {", + " return ((byte) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long) : short {", + " left as short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public short fct(final long left) {", + " return ((short) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long) : int {", + " left as int", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final long left) {", + " return ((int) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long) : long {", + " left as long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final long left) {", + " return ((long) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long) : float {", + " left as float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final long left) {", + " return ((float) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long) : double {", + " left as double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final long left) {", + " return ((double) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Byte() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long) : Byte {", + " left as Byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Byte fct(final long left) {", + " return ((Byte) Long.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Short() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long) : Short {", + " left as Short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Short fct(final long left) {", + " return ((Short) Long.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Integer() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long) : Integer {", + " left as Integer", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Integer fct(final long left) {", + " return ((Integer) Long.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long) : Long {", + " left as Long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Long fct(final long left) {", + " return ((Long) Long.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : long) : Float {", + " left as Float", + " }", + "}")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : long) : Double {", + " left as Double", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : long) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : long) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : long) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : long) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final long left) {", + " return ((Number) Long.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/number/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/number/CodeTest.java new file mode 100644 index 0000000000..b983e2dc9f --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/number/CodeTest.java @@ -0,0 +1,69 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.number; + +import static io.sarl.lang.scoping.extensions.numbers.cast.NumberCastExtensions.toAtomicDouble; +import static io.sarl.lang.scoping.extensions.numbers.cast.NumberCastExtensions.toAtomicInteger; +import static io.sarl.lang.scoping.extensions.numbers.cast.NumberCastExtensions.toAtomicLong; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Number left = new AtomicDouble(4); + + @Test + public void toAtomicLong_Number() { + AtomicLong value = toAtomicLong(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicInteger_Number() { + AtomicInteger value = toAtomicInteger(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicDouble_Number() { + AtomicDouble value = toAtomicDouble(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/number/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/number/CompilerTest.java new file mode 100644 index 0000000000..3b5127593b --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/number/CompilerTest.java @@ -0,0 +1,414 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.number; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Number) : byte {", + " left as byte", + " }", + "}")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Number) : short {", + " left as short", + " }", + "}")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Number) : int {", + " left as int", + " }", + "}")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Number) : long {", + " left as long", + " }", + "}")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Number) : float {", + " left as float", + " }", + "}")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Number) : double {", + " left as double", + " }", + "}")); + } + + @DifferedTest + public void as_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number) : Byte {", + " left as Byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Byte fct(final Number left) {", + " return ((Byte) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number) : Short {", + " left as Short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Short fct(final Number left) {", + " return ((Short) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number) : Integer {", + " left as Integer", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Integer fct(final Number left) {", + " return ((Integer) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number) : Long {", + " left as Long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Long fct(final Number left) {", + " return ((Long) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number) : Float {", + " left as Float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Float fct(final Number left) {", + " return ((Float) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number) : Double {", + " left as Double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Double fct(final Number left) {", + " return ((Double) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Number) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public AtomicInteger fct(final Number left) {", + " return ((AtomicInteger) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Number) : AtomicLong {", + " left as AtomicLong", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public AtomicLong fct(final Number left) {", + " return ((AtomicLong) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number) : AtomicDouble {", + " left as AtomicDouble", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public AtomicDouble fct(final Number left) {", + " return ((AtomicDouble) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final Number left) {", + " return ((Number) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/shortobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/shortobject/CompilerTest.java new file mode 100644 index 0000000000..4f16f363f1 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/shortobject/CompilerTest.java @@ -0,0 +1,348 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.shortobject; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Short) : byte {", + " left as byte", + " }", + "}")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short) : short {", + " left as short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public short fct(final Short left) {", + " return ((short) (left).shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short) : int {", + " left as int", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left) {", + " return ((int) (left).shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short) : long {", + " left as long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final Short left) {", + " return ((long) (left).shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short) : float {", + " left as float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final Short left) {", + " return ((float) (left).shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short) : double {", + " left as double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final Short left) {", + " return ((double) (left).shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Byte() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Short) : Byte {", + " left as Byte", + " }", + "}")); + } + + @DifferedTest + public void as_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short) : Short {", + " left as Short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Short fct(final Short left) {", + " return ((Short) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Integer() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Short) : Integer {", + " left as Integer", + " }", + "}")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Short) : Long {", + " left as Long", + " }", + "}")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Short) : Float {", + " left as Float", + " }", + "}")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : Short) : Double {", + " left as Double", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Short) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Short) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final Short left) {", + " return ((Number) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/shortprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/shortprimitive/CodeTest.java new file mode 100644 index 0000000000..81778acf70 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/shortprimitive/CodeTest.java @@ -0,0 +1,69 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.shortprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveShortCastExtensions.toAtomicDouble; +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveShortCastExtensions.toAtomicInteger; +import static io.sarl.lang.scoping.extensions.numbers.cast.PrimitiveShortCastExtensions.toAtomicLong; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static short left = 4; + + @Test + public void toAtomicLong_short() { + AtomicLong value = toAtomicLong(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicInteger_short() { + AtomicInteger value = toAtomicInteger(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + + @Test + public void toAtomicDouble_short() { + AtomicDouble value = toAtomicDouble(left); + assertNotNull(value); + assertEpsilonEquals(4., value.doubleValue()); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/shortprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/shortprimitive/CompilerTest.java new file mode 100644 index 0000000000..91fa48188b --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/cast/shortprimitive/CompilerTest.java @@ -0,0 +1,391 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.cast.shortprimitive; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void as_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short) : byte {", + " left as byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public byte fct(final short left) {", + " return ((byte) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short) : short {", + " left as short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public short fct(final short left) {", + " return ((short) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short) : int {", + " left as int", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left) {", + " return ((int) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short) : long {", + " left as long", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public long fct(final short left) {", + " return ((long) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short) : float {", + " left as float", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public float fct(final short left) {", + " return ((float) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short) : double {", + " left as double", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public double fct(final short left) {", + " return ((double) left);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Byte() throws Exception { + // FIXME: The generated code is invalid => Java compilation error. This is an issue into Xbase. + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short) : Byte {", + " left as Byte", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Byte fct(final short left) {", + " return ((Byte) Short.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short) : Short {", + " left as Short", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Short fct(final short left) {", + " return ((Short) Short.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void as_Integer() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : short) : Integer {", + " left as Integer", + " }", + "}")); + } + + @DifferedTest + public void as_Long() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : short) : Long {", + " left as Long", + " }", + "}")); + } + + @DifferedTest + public void as_Float() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : short) : Float {", + " left as Float", + " }", + "}")); + } + + @DifferedTest + public void as_Double() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "class A {", + " def fct(left : short) : Double {", + " left as Double", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicInteger() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short) : AtomicInteger {", + " left as AtomicInteger", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicLong() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short) : AtomicLong {", + " left as AtomicLong", + " }", + "}")); + } + + @DifferedTest + public void as_AtomicDouble() throws Exception { + diffSingleTypeCompileTo_unexpectedCastError(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short) : AtomicLong {", + " left as AtomicDouble", + " }", + "}")); + } + + @DifferedTest + public void as_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short) : Number {", + " left as Number", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public Number fct(final short left) {", + " return ((Number) Short.valueOf(left));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/ByteComparisonExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/ByteComparisonExtensionsTest.java deleted file mode 100644 index 05cbfd7c7d..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/ByteComparisonExtensionsTest.java +++ /dev/null @@ -1,3531 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison; - -import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_equals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_greaterEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_greaterThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_lessEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_lessThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_notEquals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_spaceship; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - ByteComparisonExtensionsTest.Code.class, - ByteComparisonExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class ByteComparisonExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Byte left = 4; - - private static Byte left2 = 2; - - private static int right = 3; - - private static int right2 = 5; - - @Test - public void operator_greaterEqualsThan_Byte_Number() { - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessEqualsThan_Byte_Number() { - assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_greaterThan_Byte_Number() { - assertTrue(operator_greaterThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessThan_Byte_Number() { - assertFalse(operator_lessThan(left, new AtomicDouble(right))); - assertTrue(operator_lessThan(left2, new AtomicDouble(right))); - assertFalse(operator_lessThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_equals_Byte_Number() { - assertFalse(operator_equals(left, new AtomicDouble(right))); - assertFalse(operator_equals(left2, new AtomicDouble(right))); - assertTrue(operator_equals(left, new AtomicDouble(left))); - } - - @Test - public void operator_notEquals_Byte_Number() { - assertTrue(operator_notEquals(left, new AtomicDouble(right))); - assertTrue(operator_notEquals(left2, new AtomicDouble(right))); - assertFalse(operator_notEquals(left, new AtomicDouble(left))); - } - - @Test - public void operator_spaceship_Byte_byte() { - assertStrictlyPositive(operator_spaceship(left, (byte) right)); - assertStrictlyNegative(operator_spaceship(left, (byte) right2)); - assertZero(operator_spaceship(left, (byte) left)); - } - - @Test - public void operator_spaceship_Byte_short() { - assertStrictlyPositive(operator_spaceship(left, (short) right)); - assertStrictlyNegative(operator_spaceship(left, (short) right2)); - assertZero(operator_spaceship(left, (short) left)); - } - - @Test - public void operator_spaceship_Byte_int() { - assertStrictlyPositive(operator_spaceship(left, (int) right)); - assertStrictlyNegative(operator_spaceship(left, (int) right2)); - assertZero(operator_spaceship(left, (int) left)); - } - - @Test - public void operator_spaceship_Byte_long() { - assertStrictlyPositive(operator_spaceship(left, (long) right)); - assertStrictlyNegative(operator_spaceship(left, (long) right2)); - assertZero(operator_spaceship(left, (long) left)); - } - - @Test - public void operator_spaceship_Byte_float() { - assertStrictlyPositive(operator_spaceship(left, (float) right)); - assertStrictlyNegative(operator_spaceship(left, (float) right2)); - assertZero(operator_spaceship(left, (float) left)); - } - - @Test - public void operator_spaceship_Byte_double() { - assertStrictlyPositive(operator_spaceship(left, (double) right)); - assertStrictlyNegative(operator_spaceship(left, (double) right2)); - assertZero(operator_spaceship(left, (double) left)); - } - - @Test - public void operator_spaceship_Byte_Byte() { - assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); - assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); - assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); - } - - @Test - public void operator_spaceship_Byte_Short() { - assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); - assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); - assertZero(operator_spaceship(left, Short.valueOf((short) left))); - } - - @Test - public void operator_spaceship_Byte_Integer() { - assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); - assertZero(operator_spaceship(left, Integer.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_Long() { - assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); - assertZero(operator_spaceship(left, Long.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_Float() { - assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); - assertZero(operator_spaceship(left, Float.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_Double() { - assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); - assertZero(operator_spaceship(left, Double.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() { - assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); - assertZero(operator_spaceship(left, new AtomicInteger(left))); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() { - assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); - assertZero(operator_spaceship(left, new AtomicLong(left))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_greaterThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final byte right) {", - " return (left.byteValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final short right) {", - " return (left.byteValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : int) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final int right) {", - " return (left.byteValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final long right) {", - " return (left.byteValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final float right) {", - " return (left.byteValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final double right) {", - " return (left.byteValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Byte right) {", - " return (left.byteValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Short right) {", - " return (left.byteValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Integer) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Integer right) {", - " return (left.byteValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Long right) {", - " return (left.byteValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Float right) {", - " return (left.byteValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Double right) {", - " return (left.byteValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_greaterThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Byte, right : AtomicInteger) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicInteger right) {", - " return (left.byteValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Byte, right : AtomicLong) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicLong right) {", - " return (left.byteValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte, right : AtomicDouble) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicDouble right) {", - " return (left.byteValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final byte right) {", - " return (left.byteValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final short right) {", - " return (left.byteValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : int) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final int right) {", - " return (left.byteValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final long right) {", - " return (left.byteValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final float right) {", - " return (left.byteValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final double right) {", - " return (left.byteValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Byte right) {", - " return (left.byteValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Short right) {", - " return (left.byteValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Integer) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Integer right) {", - " return (left.byteValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Long right) {", - " return (left.byteValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Float right) {", - " return (left.byteValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Double right) {", - " return (left.byteValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Byte, right : AtomicInteger) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicInteger right) {", - " return (left.byteValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Byte, right : AtomicLong) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicLong right) {", - " return (left.byteValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte, right : AtomicDouble) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicDouble right) {", - " return (left.byteValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final byte right) {", - " return (left.byteValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final short right) {", - " return (left.byteValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : int) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final int right) {", - " return (left.byteValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final long right) {", - " return (left.byteValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final float right) {", - " return (left.byteValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final double right) {", - " return (left.byteValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Byte right) {", - " return (left.byteValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Short right) {", - " return (left.byteValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Integer) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Integer right) {", - " return (left.byteValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Long right) {", - " return (left.byteValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Float right) {", - " return (left.byteValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Double right) {", - " return (left.byteValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Byte, right : AtomicInteger) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicInteger right) {", - " return (left.byteValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Byte, right : AtomicLong) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicLong right) {", - " return (left.byteValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte, right : AtomicDouble) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicDouble right) {", - " return (left.byteValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final byte right) {", - " return (left.byteValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final short right) {", - " return (left.byteValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : int) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final int right) {", - " return (left.byteValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final long right) {", - " return (left.byteValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final float right) {", - " return (left.byteValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final double right) {", - " return (left.byteValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Byte right) {", - " return (left.byteValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Short right) {", - " return (left.byteValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Integer) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Integer right) {", - " return (left.byteValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Long right) {", - " return (left.byteValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Float right) {", - " return (left.byteValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Double right) {", - " return (left.byteValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Byte, right : AtomicInteger) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicInteger right) {", - " return (left.byteValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Byte, right : AtomicLong) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicLong right) {", - " return (left.byteValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte, right : AtomicDouble) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicDouble right) {", - " return (left.byteValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final byte right) {", - " return (left != null && (left.byteValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final short right) {", - " return (left != null && (left.byteValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : int) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final int right) {", - " return (left != null && (left.byteValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final long right) {", - " return (left != null && (left.byteValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final float right) {", - " return (left != null && (left.byteValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final double right) {", - " return (left != null && (left.byteValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Byte right) {", - " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Short right) {", - " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Integer) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Integer right) {", - " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Long right) {", - " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Float right) {", - " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Double right) {", - " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Byte, right : AtomicInteger) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicInteger right) {", - " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Byte, right : AtomicLong) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicLong right) {", - " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte, right : AtomicDouble) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicDouble right) {", - " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_notEquals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final byte right) {", - " return (left == null || (left.byteValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final short right) {", - " return (left == null || (left.byteValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : int) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final int right) {", - " return (left == null || (left.byteValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final long right) {", - " return (left == null || (left.byteValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final float right) {", - " return (left == null || (left.byteValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final double right) {", - " return (left == null || (left.byteValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Byte right) {", - " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Short right) {", - " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Integer) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Integer right) {", - " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Long right) {", - " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Float right) {", - " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final Double right) {", - " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Byte, right : AtomicInteger) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicInteger right) {", - " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Byte, right : AtomicLong) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicLong right) {", - " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte, right : AtomicDouble) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Byte left, final AtomicDouble right) {", - " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final byte right) {", - " return Byte.compare(left.byteValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final short right) {", - " return Short.compare(left.byteValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : int) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final int right) {", - " return Integer.compare(left.byteValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final long right) {", - " return Long.compare(left.byteValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final float right) {", - " return Float.compare(left.byteValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final double right) {", - " return Double.compare(left.byteValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Byte right) {", - " return Byte.compare(left.byteValue(), right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Short right) {", - " return Short.compare(left.byteValue(), right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Integer) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Integer right) {", - " return Integer.compare(left.byteValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Long right) {", - " return Long.compare(left.byteValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Float right) {", - " return Float.compare(left.byteValue(), right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Byte, right : Double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final Double right) {", - " return Double.compare(left.byteValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Byte, right : AtomicInteger) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final AtomicInteger right) {", - " return Integer.compare(left.byteValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Byte, right : AtomicLong) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final AtomicLong right) {", - " return Long.compare(left.byteValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Byte, right : AtomicDouble) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Byte left, final AtomicDouble right) {", - " return Double.compare(left.byteValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/DoubleComparisonExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/DoubleComparisonExtensionsTest.java deleted file mode 100644 index 8eb7aee9bd..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/DoubleComparisonExtensionsTest.java +++ /dev/null @@ -1,3531 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison; - -import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_equals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_greaterEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_greaterThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_lessEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_lessThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_notEquals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_spaceship; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - DoubleComparisonExtensionsTest.Code.class, - DoubleComparisonExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class DoubleComparisonExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Double left = 4.; - - private static Double left2 = 2.; - - private static int right = 3; - - private static int right2 = 5; - - @Test - public void operator_greaterEqualsThan_Byte_Number() { - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessEqualsThan_Byte_Number() { - assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_greaterThan_Byte_Number() { - assertTrue(operator_greaterThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessThan_Byte_Number() { - assertFalse(operator_lessThan(left, new AtomicDouble(right))); - assertTrue(operator_lessThan(left2, new AtomicDouble(right))); - assertFalse(operator_lessThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_equals_Byte_Number() { - assertFalse(operator_equals(left, new AtomicDouble(right))); - assertFalse(operator_equals(left2, new AtomicDouble(right))); - assertTrue(operator_equals(left, new AtomicDouble(left))); - } - - @Test - public void operator_notEquals_Byte_Number() { - assertTrue(operator_notEquals(left, new AtomicDouble(right))); - assertTrue(operator_notEquals(left2, new AtomicDouble(right))); - assertFalse(operator_notEquals(left, new AtomicDouble(left))); - } - - @Test - public void operator_spaceship_Byte_byte() { - assertStrictlyPositive(operator_spaceship(left, (byte) right)); - assertStrictlyNegative(operator_spaceship(left, (byte) right2)); - assertZero(operator_spaceship(left, left.byteValue())); - } - - @Test - public void operator_spaceship_Byte_short() { - assertStrictlyPositive(operator_spaceship(left, (short) right)); - assertStrictlyNegative(operator_spaceship(left, (short) right2)); - assertZero(operator_spaceship(left, (short) left.doubleValue())); - } - - @Test - public void operator_spaceship_Byte_int() { - assertStrictlyPositive(operator_spaceship(left, (int) right)); - assertStrictlyNegative(operator_spaceship(left, (int) right2)); - assertZero(operator_spaceship(left, (int) left.doubleValue())); - } - - @Test - public void operator_spaceship_Byte_long() { - assertStrictlyPositive(operator_spaceship(left, (long) right)); - assertStrictlyNegative(operator_spaceship(left, (long) right2)); - assertZero(operator_spaceship(left, (long) left.longValue())); - } - - @Test - public void operator_spaceship_Byte_float() { - assertStrictlyPositive(operator_spaceship(left, (float) right)); - assertStrictlyNegative(operator_spaceship(left, (float) right2)); - assertZero(operator_spaceship(left, (float) left.floatValue())); - } - - @Test - public void operator_spaceship_Byte_double() { - assertStrictlyPositive(operator_spaceship(left, (double) right)); - assertStrictlyNegative(operator_spaceship(left, (double) right2)); - assertZero(operator_spaceship(left, (double) left)); - } - - @Test - public void operator_spaceship_Byte_Byte() { - assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); - assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); - assertZero(operator_spaceship(left, Byte.valueOf(left.byteValue()))); - } - - @Test - public void operator_spaceship_Byte_Short() { - assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); - assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); - assertZero(operator_spaceship(left, Short.valueOf((short) left.doubleValue()))); - } - - @Test - public void operator_spaceship_Byte_Integer() { - assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); - assertZero(operator_spaceship(left, Integer.valueOf(left.intValue()))); - } - - @Test - public void operator_spaceship_Byte_Long() { - assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); - assertZero(operator_spaceship(left, Long.valueOf(left.longValue()))); - } - - @Test - public void operator_spaceship_Byte_Float() { - assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); - assertZero(operator_spaceship(left, Float.valueOf(left.floatValue()))); - } - - @Test - public void operator_spaceship_Byte_Double() { - assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); - assertZero(operator_spaceship(left, Double.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() { - assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); - assertZero(operator_spaceship(left, new AtomicInteger(left.intValue()))); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() { - assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); - assertZero(operator_spaceship(left, new AtomicLong(left.longValue()))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_greaterThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final byte right) {", - " return (left.doubleValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final short right) {", - " return (left.doubleValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : int) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final int right) {", - " return (left.doubleValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final long right) {", - " return (left.doubleValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final float right) {", - " return (left.doubleValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final double right) {", - " return (left.doubleValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Byte right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Short right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Integer) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Integer right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Long right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Float right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Double right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_greaterThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Double, right : AtomicInteger) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicInteger right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Double, right : AtomicLong) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicLong right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double, right : AtomicDouble) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicDouble right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final byte right) {", - " return (left.doubleValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final short right) {", - " return (left.doubleValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : int) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final int right) {", - " return (left.doubleValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final long right) {", - " return (left.doubleValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final float right) {", - " return (left.doubleValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final double right) {", - " return (left.doubleValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Byte right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Short right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Integer) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Integer right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Long right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Float right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Double right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Double, right : AtomicInteger) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicInteger right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Double, right : AtomicLong) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicLong right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double, right : AtomicDouble) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicDouble right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final byte right) {", - " return (left.doubleValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final short right) {", - " return (left.doubleValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : int) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final int right) {", - " return (left.doubleValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final long right) {", - " return (left.doubleValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final float right) {", - " return (left.doubleValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final double right) {", - " return (left.doubleValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Byte right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Short right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Integer) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Integer right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Long right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Float right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Double right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Double, right : AtomicInteger) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicInteger right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Double, right : AtomicLong) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicLong right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double, right : AtomicDouble) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicDouble right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final byte right) {", - " return (left.doubleValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final short right) {", - " return (left.doubleValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : int) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final int right) {", - " return (left.doubleValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final long right) {", - " return (left.doubleValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final float right) {", - " return (left.doubleValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final double right) {", - " return (left.doubleValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Byte right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Short right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Integer) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Integer right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Long right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Float right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Double right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Double, right : AtomicInteger) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicInteger right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Double, right : AtomicLong) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicLong right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double, right : AtomicDouble) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicDouble right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final byte right) {", - " return (left != null && (left.doubleValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final short right) {", - " return (left != null && (left.doubleValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : int) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final int right) {", - " return (left != null && (left.doubleValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final long right) {", - " return (left != null && (left.doubleValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final float right) {", - " return (left != null && (left.doubleValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final double right) {", - " return (left != null && (left.doubleValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Byte right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Short right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Integer) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Integer right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Long right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Float right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Double right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Double, right : AtomicInteger) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicInteger right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Double, right : AtomicLong) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicLong right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double, right : AtomicDouble) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicDouble right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_notEquals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final byte right) {", - " return (left == null || (left.doubleValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final short right) {", - " return (left == null || (left.doubleValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : int) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final int right) {", - " return (left == null || (left.doubleValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final long right) {", - " return (left == null || (left.doubleValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final float right) {", - " return (left == null || (left.doubleValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final double right) {", - " return (left == null || (left.doubleValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Byte right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Short right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Integer) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Integer right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Long right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Float right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final Double right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Double, right : AtomicInteger) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicInteger right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Double, right : AtomicLong) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicLong right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double, right : AtomicDouble) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Double left, final AtomicDouble right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final byte right) {", - " return Double.compare(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final short right) {", - " return Double.compare(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : int) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final int right) {", - " return Double.compare(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final long right) {", - " return Double.compare(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final float right) {", - " return Double.compare(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final double right) {", - " return Double.compare(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final Byte right) {", - " return Double.compare(left.doubleValue(), right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final Short right) {", - " return Double.compare(left.doubleValue(), right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Integer) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final Integer right) {", - " return Double.compare(left.doubleValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final Long right) {", - " return Double.compare(left.doubleValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final Float right) {", - " return Double.compare(left.doubleValue(), right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Double, right : Double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final Double right) {", - " return Double.compare(left.doubleValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Double, right : AtomicInteger) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final AtomicInteger right) {", - " return Double.compare(left.doubleValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Double, right : AtomicLong) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final AtomicLong right) {", - " return Double.compare(left.doubleValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Double, right : AtomicDouble) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Double left, final AtomicDouble right) {", - " return Double.compare(left.doubleValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/FloatComparisonExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/FloatComparisonExtensionsTest.java deleted file mode 100644 index 1437bb9472..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/FloatComparisonExtensionsTest.java +++ /dev/null @@ -1,3531 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison; - -import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_equals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_greaterEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_greaterThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_lessEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_lessThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_notEquals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_spaceship; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - FloatComparisonExtensionsTest.Code.class, - FloatComparisonExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class FloatComparisonExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Float left = 4f; - - private static Float left2 = 2f; - - private static int right = 3; - - private static int right2 = 5; - - @Test - public void operator_greaterEqualsThan_Byte_Number() { - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessEqualsThan_Byte_Number() { - assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_greaterThan_Byte_Number() { - assertTrue(operator_greaterThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessThan_Byte_Number() { - assertFalse(operator_lessThan(left, new AtomicDouble(right))); - assertTrue(operator_lessThan(left2, new AtomicDouble(right))); - assertFalse(operator_lessThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_equals_Byte_Number() { - assertFalse(operator_equals(left, new AtomicDouble(right))); - assertFalse(operator_equals(left2, new AtomicDouble(right))); - assertTrue(operator_equals(left, new AtomicDouble(left))); - } - - @Test - public void operator_notEquals_Byte_Number() { - assertTrue(operator_notEquals(left, new AtomicDouble(right))); - assertTrue(operator_notEquals(left2, new AtomicDouble(right))); - assertFalse(operator_notEquals(left, new AtomicDouble(left))); - } - - @Test - public void operator_spaceship_Byte_byte() { - assertStrictlyPositive(operator_spaceship(left, (byte) right)); - assertStrictlyNegative(operator_spaceship(left, (byte) right2)); - assertZero(operator_spaceship(left, left.byteValue())); - } - - @Test - public void operator_spaceship_Byte_short() { - assertStrictlyPositive(operator_spaceship(left, (short) right)); - assertStrictlyNegative(operator_spaceship(left, (short) right2)); - assertZero(operator_spaceship(left, (short) left.floatValue())); - } - - @Test - public void operator_spaceship_Byte_int() { - assertStrictlyPositive(operator_spaceship(left, (int) right)); - assertStrictlyNegative(operator_spaceship(left, (int) right2)); - assertZero(operator_spaceship(left, (int) left.floatValue())); - } - - @Test - public void operator_spaceship_Byte_long() { - assertStrictlyPositive(operator_spaceship(left, (long) right)); - assertStrictlyNegative(operator_spaceship(left, (long) right2)); - assertZero(operator_spaceship(left, (long) left.longValue())); - } - - @Test - public void operator_spaceship_Byte_float() { - assertStrictlyPositive(operator_spaceship(left, (float) right)); - assertStrictlyNegative(operator_spaceship(left, (float) right2)); - assertZero(operator_spaceship(left, (float) left)); - } - - @Test - public void operator_spaceship_Byte_double() { - assertStrictlyPositive(operator_spaceship(left, (double) right)); - assertStrictlyNegative(operator_spaceship(left, (double) right2)); - assertZero(operator_spaceship(left, (double) left)); - } - - @Test - public void operator_spaceship_Byte_Byte() { - assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); - assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); - assertZero(operator_spaceship(left, Byte.valueOf(left.byteValue()))); - } - - @Test - public void operator_spaceship_Byte_Short() { - assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); - assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); - assertZero(operator_spaceship(left, Short.valueOf((short) left.floatValue()))); - } - - @Test - public void operator_spaceship_Byte_Integer() { - assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); - assertZero(operator_spaceship(left, Integer.valueOf(left.intValue()))); - } - - @Test - public void operator_spaceship_Byte_Long() { - assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); - assertZero(operator_spaceship(left, Long.valueOf(left.longValue()))); - } - - @Test - public void operator_spaceship_Byte_Float() { - assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); - assertZero(operator_spaceship(left, Float.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_Double() { - assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); - assertZero(operator_spaceship(left, Double.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() { - assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); - assertZero(operator_spaceship(left, new AtomicInteger(left.intValue()))); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() { - assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); - assertZero(operator_spaceship(left, new AtomicLong(left.longValue()))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_greaterThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final byte right) {", - " return (left.floatValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final short right) {", - " return (left.floatValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : int) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final int right) {", - " return (left.floatValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final long right) {", - " return (left.floatValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final float right) {", - " return (left.floatValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final double right) {", - " return (left.floatValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Byte right) {", - " return (left.floatValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Short right) {", - " return (left.floatValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Integer) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Integer right) {", - " return (left.floatValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Long right) {", - " return (left.floatValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Float right) {", - " return (left.floatValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Double right) {", - " return (left.floatValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_greaterThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Float, right : AtomicInteger) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicInteger right) {", - " return (left.floatValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Float, right : AtomicLong) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicLong right) {", - " return (left.floatValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float, right : AtomicDouble) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicDouble right) {", - " return (left.floatValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final byte right) {", - " return (left.floatValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final short right) {", - " return (left.floatValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : int) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final int right) {", - " return (left.floatValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final long right) {", - " return (left.floatValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final float right) {", - " return (left.floatValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final double right) {", - " return (left.floatValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Byte right) {", - " return (left.floatValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Short right) {", - " return (left.floatValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Integer) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Integer right) {", - " return (left.floatValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Long right) {", - " return (left.floatValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Float right) {", - " return (left.floatValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Double right) {", - " return (left.floatValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Float, right : AtomicInteger) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicInteger right) {", - " return (left.floatValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Float, right : AtomicLong) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicLong right) {", - " return (left.floatValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float, right : AtomicDouble) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicDouble right) {", - " return (left.floatValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final byte right) {", - " return (left.floatValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final short right) {", - " return (left.floatValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : int) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final int right) {", - " return (left.floatValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final long right) {", - " return (left.floatValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final float right) {", - " return (left.floatValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final double right) {", - " return (left.floatValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Byte right) {", - " return (left.floatValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Short right) {", - " return (left.floatValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Integer) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Integer right) {", - " return (left.floatValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Long right) {", - " return (left.floatValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Float right) {", - " return (left.floatValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Double right) {", - " return (left.floatValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Float, right : AtomicInteger) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicInteger right) {", - " return (left.floatValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Float, right : AtomicLong) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicLong right) {", - " return (left.floatValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float, right : AtomicDouble) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicDouble right) {", - " return (left.floatValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final byte right) {", - " return (left.floatValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final short right) {", - " return (left.floatValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : int) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final int right) {", - " return (left.floatValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final long right) {", - " return (left.floatValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final float right) {", - " return (left.floatValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final double right) {", - " return (left.floatValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Byte right) {", - " return (left.floatValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Short right) {", - " return (left.floatValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Integer) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Integer right) {", - " return (left.floatValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Long right) {", - " return (left.floatValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Float right) {", - " return (left.floatValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Double right) {", - " return (left.floatValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Float, right : AtomicInteger) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicInteger right) {", - " return (left.floatValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Float, right : AtomicLong) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicLong right) {", - " return (left.floatValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float, right : AtomicDouble) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicDouble right) {", - " return (left.floatValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final byte right) {", - " return (left != null && (left.floatValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final short right) {", - " return (left != null && (left.floatValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : int) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final int right) {", - " return (left != null && (left.floatValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final long right) {", - " return (left != null && (left.floatValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final float right) {", - " return (left != null && (left.floatValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final double right) {", - " return (left != null && (left.floatValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Byte right) {", - " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Short right) {", - " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Integer) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Integer right) {", - " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Long right) {", - " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Float right) {", - " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Double right) {", - " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Float, right : AtomicInteger) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicInteger right) {", - " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Float, right : AtomicLong) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicLong right) {", - " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float, right : AtomicDouble) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicDouble right) {", - " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_notEquals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final byte right) {", - " return (left == null || (left.floatValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final short right) {", - " return (left == null || (left.floatValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : int) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final int right) {", - " return (left == null || (left.floatValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final long right) {", - " return (left == null || (left.floatValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final float right) {", - " return (left == null || (left.floatValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final double right) {", - " return (left == null || (left.floatValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Byte right) {", - " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Short right) {", - " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Integer) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Integer right) {", - " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Long right) {", - " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Float right) {", - " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final Double right) {", - " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Float, right : AtomicInteger) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicInteger right) {", - " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Float, right : AtomicLong) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicLong right) {", - " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float, right : AtomicDouble) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Float left, final AtomicDouble right) {", - " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final byte right) {", - " return Float.compare(left.floatValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final short right) {", - " return Float.compare(left.floatValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : int) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final int right) {", - " return Float.compare(left.floatValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final long right) {", - " return Float.compare(left.floatValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final float right) {", - " return Float.compare(left.floatValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final double right) {", - " return Double.compare(left.floatValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final Byte right) {", - " return Float.compare(left.floatValue(), right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final Short right) {", - " return Float.compare(left.floatValue(), right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Integer) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final Integer right) {", - " return Float.compare(left.floatValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final Long right) {", - " return Float.compare(left.floatValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final Float right) {", - " return Float.compare(left.floatValue(), right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Float, right : Double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final Double right) {", - " return Double.compare(left.floatValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Float, right : AtomicInteger) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final AtomicInteger right) {", - " return Float.compare(left.floatValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Float, right : AtomicLong) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final AtomicLong right) {", - " return Float.compare(left.floatValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Float, right : AtomicDouble) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Float left, final AtomicDouble right) {", - " return Double.compare(left.floatValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/IntegerComparisonExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/IntegerComparisonExtensionsTest.java deleted file mode 100644 index 554fd18469..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/IntegerComparisonExtensionsTest.java +++ /dev/null @@ -1,3531 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison; - -import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_equals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_greaterEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_greaterThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_lessEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_lessThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_notEquals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_spaceship; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - IntegerComparisonExtensionsTest.Code.class, - IntegerComparisonExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class IntegerComparisonExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Integer left = 4; - - private static Integer left2 = 2; - - private static int right = 3; - - private static int right2 = 5; - - @Test - public void operator_greaterEqualsThan_Byte_Number() { - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessEqualsThan_Byte_Number() { - assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_greaterThan_Byte_Number() { - assertTrue(operator_greaterThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessThan_Byte_Number() { - assertFalse(operator_lessThan(left, new AtomicDouble(right))); - assertTrue(operator_lessThan(left2, new AtomicDouble(right))); - assertFalse(operator_lessThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_equals_Byte_Number() { - assertFalse(operator_equals(left, new AtomicDouble(right))); - assertFalse(operator_equals(left2, new AtomicDouble(right))); - assertTrue(operator_equals(left, new AtomicDouble(left))); - } - - @Test - public void operator_notEquals_Byte_Number() { - assertTrue(operator_notEquals(left, new AtomicDouble(right))); - assertTrue(operator_notEquals(left2, new AtomicDouble(right))); - assertFalse(operator_notEquals(left, new AtomicDouble(left))); - } - - @Test - public void operator_spaceship_Byte_byte() { - assertStrictlyPositive(operator_spaceship(left, (byte) right)); - assertStrictlyNegative(operator_spaceship(left, (byte) right2)); - assertZero(operator_spaceship(left, left.byteValue())); - } - - @Test - public void operator_spaceship_Byte_short() { - assertStrictlyPositive(operator_spaceship(left, (short) right)); - assertStrictlyNegative(operator_spaceship(left, (short) right2)); - assertZero(operator_spaceship(left, (short) left.intValue())); - } - - @Test - public void operator_spaceship_Byte_int() { - assertStrictlyPositive(operator_spaceship(left, (int) right)); - assertStrictlyNegative(operator_spaceship(left, (int) right2)); - assertZero(operator_spaceship(left, (int) left)); - } - - @Test - public void operator_spaceship_Byte_long() { - assertStrictlyPositive(operator_spaceship(left, (long) right)); - assertStrictlyNegative(operator_spaceship(left, (long) right2)); - assertZero(operator_spaceship(left, (long) left)); - } - - @Test - public void operator_spaceship_Byte_float() { - assertStrictlyPositive(operator_spaceship(left, (float) right)); - assertStrictlyNegative(operator_spaceship(left, (float) right2)); - assertZero(operator_spaceship(left, (float) left)); - } - - @Test - public void operator_spaceship_Byte_double() { - assertStrictlyPositive(operator_spaceship(left, (double) right)); - assertStrictlyNegative(operator_spaceship(left, (double) right2)); - assertZero(operator_spaceship(left, (double) left)); - } - - @Test - public void operator_spaceship_Byte_Byte() { - assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); - assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); - assertZero(operator_spaceship(left, Byte.valueOf(left.byteValue()))); - } - - @Test - public void operator_spaceship_Byte_Short() { - assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); - assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); - assertZero(operator_spaceship(left, Short.valueOf((short) left.intValue()))); - } - - @Test - public void operator_spaceship_Byte_Integer() { - assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); - assertZero(operator_spaceship(left, Integer.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_Long() { - assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); - assertZero(operator_spaceship(left, Long.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_Float() { - assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); - assertZero(operator_spaceship(left, Float.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_Double() { - assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); - assertZero(operator_spaceship(left, Double.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() { - assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); - assertZero(operator_spaceship(left, new AtomicInteger(left))); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() { - assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); - assertZero(operator_spaceship(left, new AtomicLong(left))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_greaterThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final byte right) {", - " return (left.intValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final short right) {", - " return (left.intValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : int) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final int right) {", - " return (left.intValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final long right) {", - " return (left.intValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final float right) {", - " return (left.intValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final double right) {", - " return (left.intValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Byte right) {", - " return (left.intValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Short right) {", - " return (left.intValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Integer) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Integer right) {", - " return (left.intValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Long right) {", - " return (left.intValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Float right) {", - " return (left.intValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Double right) {", - " return (left.intValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_greaterThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Integer, right : AtomicInteger) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicInteger right) {", - " return (left.intValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Integer, right : AtomicLong) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicLong right) {", - " return (left.intValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer, right : AtomicDouble) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicDouble right) {", - " return (left.intValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final byte right) {", - " return (left.intValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final short right) {", - " return (left.intValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : int) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final int right) {", - " return (left.intValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final long right) {", - " return (left.intValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final float right) {", - " return (left.intValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final double right) {", - " return (left.intValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Byte right) {", - " return (left.intValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Short right) {", - " return (left.intValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Integer) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Integer right) {", - " return (left.intValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Long right) {", - " return (left.intValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Float right) {", - " return (left.intValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Double right) {", - " return (left.intValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Integer, right : AtomicInteger) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicInteger right) {", - " return (left.intValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Integer, right : AtomicLong) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicLong right) {", - " return (left.intValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer, right : AtomicDouble) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicDouble right) {", - " return (left.intValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final byte right) {", - " return (left.intValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final short right) {", - " return (left.intValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : int) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final int right) {", - " return (left.intValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final long right) {", - " return (left.intValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final float right) {", - " return (left.intValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final double right) {", - " return (left.intValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Byte right) {", - " return (left.intValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Short right) {", - " return (left.intValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Integer) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Integer right) {", - " return (left.intValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Long right) {", - " return (left.intValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Float right) {", - " return (left.intValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Double right) {", - " return (left.intValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Integer, right : AtomicInteger) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicInteger right) {", - " return (left.intValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Integer, right : AtomicLong) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicLong right) {", - " return (left.intValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer, right : AtomicDouble) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicDouble right) {", - " return (left.intValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final byte right) {", - " return (left.intValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final short right) {", - " return (left.intValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : int) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final int right) {", - " return (left.intValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final long right) {", - " return (left.intValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final float right) {", - " return (left.intValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final double right) {", - " return (left.intValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Byte right) {", - " return (left.intValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Short right) {", - " return (left.intValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Integer) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Integer right) {", - " return (left.intValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Long right) {", - " return (left.intValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Float right) {", - " return (left.intValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Double right) {", - " return (left.intValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Integer, right : AtomicInteger) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicInteger right) {", - " return (left.intValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Integer, right : AtomicLong) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicLong right) {", - " return (left.intValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer, right : AtomicDouble) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicDouble right) {", - " return (left.intValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final byte right) {", - " return (left != null && (left.intValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final short right) {", - " return (left != null && (left.intValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : int) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final int right) {", - " return (left != null && (left.intValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final long right) {", - " return (left != null && (left.intValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final float right) {", - " return (left != null && (left.intValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final double right) {", - " return (left != null && (left.intValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Byte right) {", - " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Short right) {", - " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Integer) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Integer right) {", - " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Long right) {", - " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Float right) {", - " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Double right) {", - " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Integer, right : AtomicInteger) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicInteger right) {", - " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Integer, right : AtomicLong) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicLong right) {", - " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer, right : AtomicDouble) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicDouble right) {", - " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_notEquals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final byte right) {", - " return (left == null || (left.intValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final short right) {", - " return (left == null || (left.intValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : int) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final int right) {", - " return (left == null || (left.intValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final long right) {", - " return (left == null || (left.intValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final float right) {", - " return (left == null || (left.intValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final double right) {", - " return (left == null || (left.intValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Byte right) {", - " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Short right) {", - " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Integer) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Integer right) {", - " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Long right) {", - " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Float right) {", - " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final Double right) {", - " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Integer, right : AtomicInteger) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicInteger right) {", - " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Integer, right : AtomicLong) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicLong right) {", - " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer, right : AtomicDouble) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Integer left, final AtomicDouble right) {", - " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final byte right) {", - " return Integer.compare(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final short right) {", - " return Integer.compare(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : int) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final int right) {", - " return Integer.compare(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final long right) {", - " return Long.compare(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final float right) {", - " return Float.compare(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final double right) {", - " return Double.compare(left.intValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Byte right) {", - " return Integer.compare(left.intValue(), right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Short right) {", - " return Integer.compare(left.intValue(), right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Integer) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Integer right) {", - " return Integer.compare(left.intValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Long right) {", - " return Long.compare(left.intValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Float right) {", - " return Float.compare(left.intValue(), right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Integer, right : Double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final Double right) {", - " return Double.compare(left.intValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Integer, right : AtomicInteger) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final AtomicInteger right) {", - " return Integer.compare(left.intValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Integer, right : AtomicLong) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final AtomicLong right) {", - " return Long.compare(left.intValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Integer, right : AtomicDouble) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Integer left, final AtomicDouble right) {", - " return Double.compare(left.intValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/LongComparisonExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/LongComparisonExtensionsTest.java deleted file mode 100644 index f059255208..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/LongComparisonExtensionsTest.java +++ /dev/null @@ -1,3531 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison; - -import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_equals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_greaterEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_greaterThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_lessEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_lessThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_notEquals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_spaceship; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - LongComparisonExtensionsTest.Code.class, - LongComparisonExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class LongComparisonExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Long left = 4l; - - private static Long left2 = 2l; - - private static int right = 3; - - private static int right2 = 5; - - @Test - public void operator_greaterEqualsThan_Byte_Number() { - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessEqualsThan_Byte_Number() { - assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_greaterThan_Byte_Number() { - assertTrue(operator_greaterThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessThan_Byte_Number() { - assertFalse(operator_lessThan(left, new AtomicDouble(right))); - assertTrue(operator_lessThan(left2, new AtomicDouble(right))); - assertFalse(operator_lessThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_equals_Byte_Number() { - assertFalse(operator_equals(left, new AtomicDouble(right))); - assertFalse(operator_equals(left2, new AtomicDouble(right))); - assertTrue(operator_equals(left, new AtomicDouble(left))); - } - - @Test - public void operator_notEquals_Byte_Number() { - assertTrue(operator_notEquals(left, new AtomicDouble(right))); - assertTrue(operator_notEquals(left2, new AtomicDouble(right))); - assertFalse(operator_notEquals(left, new AtomicDouble(left))); - } - - @Test - public void operator_spaceship_Byte_byte() { - assertStrictlyPositive(operator_spaceship(left, (byte) right)); - assertStrictlyNegative(operator_spaceship(left, (byte) right2)); - assertZero(operator_spaceship(left, left.byteValue())); - } - - @Test - public void operator_spaceship_Byte_short() { - assertStrictlyPositive(operator_spaceship(left, (short) right)); - assertStrictlyNegative(operator_spaceship(left, (short) right2)); - assertZero(operator_spaceship(left, (short) left.longValue())); - } - - @Test - public void operator_spaceship_Byte_int() { - assertStrictlyPositive(operator_spaceship(left, (int) right)); - assertStrictlyNegative(operator_spaceship(left, (int) right2)); - assertZero(operator_spaceship(left, (int) left.longValue())); - } - - @Test - public void operator_spaceship_Byte_long() { - assertStrictlyPositive(operator_spaceship(left, (long) right)); - assertStrictlyNegative(operator_spaceship(left, (long) right2)); - assertZero(operator_spaceship(left, (long) left)); - } - - @Test - public void operator_spaceship_Byte_float() { - assertStrictlyPositive(operator_spaceship(left, (float) right)); - assertStrictlyNegative(operator_spaceship(left, (float) right2)); - assertZero(operator_spaceship(left, (float) left)); - } - - @Test - public void operator_spaceship_Byte_double() { - assertStrictlyPositive(operator_spaceship(left, (double) right)); - assertStrictlyNegative(operator_spaceship(left, (double) right2)); - assertZero(operator_spaceship(left, (double) left)); - } - - @Test - public void operator_spaceship_Byte_Byte() { - assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); - assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); - assertZero(operator_spaceship(left, Byte.valueOf(left.byteValue()))); - } - - @Test - public void operator_spaceship_Byte_Short() { - assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); - assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); - assertZero(operator_spaceship(left, Short.valueOf((short) left.longValue()))); - } - - @Test - public void operator_spaceship_Byte_Integer() { - assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); - assertZero(operator_spaceship(left, Integer.valueOf(left.intValue()))); - } - - @Test - public void operator_spaceship_Byte_Long() { - assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); - assertZero(operator_spaceship(left, Long.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_Float() { - assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); - assertZero(operator_spaceship(left, Float.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_Double() { - assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); - assertZero(operator_spaceship(left, Double.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() { - assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); - assertZero(operator_spaceship(left, new AtomicInteger(left.intValue()))); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() { - assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); - assertZero(operator_spaceship(left, new AtomicLong(left))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_greaterThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final byte right) {", - " return (left.longValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final short right) {", - " return (left.longValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : int) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final int right) {", - " return (left.longValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final long right) {", - " return (left.longValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final float right) {", - " return (left.longValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final double right) {", - " return (left.longValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Byte right) {", - " return (left.longValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Short right) {", - " return (left.longValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Integer) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Integer right) {", - " return (left.longValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Long right) {", - " return (left.longValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Float right) {", - " return (left.longValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Double right) {", - " return (left.longValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_greaterThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Long, right : AtomicInteger) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicInteger right) {", - " return (left.longValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Long, right : AtomicLong) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicLong right) {", - " return (left.longValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long, right : AtomicDouble) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicDouble right) {", - " return (left.longValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final byte right) {", - " return (left.longValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final short right) {", - " return (left.longValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : int) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final int right) {", - " return (left.longValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final long right) {", - " return (left.longValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final float right) {", - " return (left.longValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final double right) {", - " return (left.longValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Byte right) {", - " return (left.longValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Short right) {", - " return (left.longValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Integer) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Integer right) {", - " return (left.longValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Long right) {", - " return (left.longValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Float right) {", - " return (left.longValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Double right) {", - " return (left.longValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Long, right : AtomicInteger) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicInteger right) {", - " return (left.longValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Long, right : AtomicLong) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicLong right) {", - " return (left.longValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long, right : AtomicDouble) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicDouble right) {", - " return (left.longValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final byte right) {", - " return (left.longValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final short right) {", - " return (left.longValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : int) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final int right) {", - " return (left.longValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final long right) {", - " return (left.longValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final float right) {", - " return (left.longValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final double right) {", - " return (left.longValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Byte right) {", - " return (left.longValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Short right) {", - " return (left.longValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Integer) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Integer right) {", - " return (left.longValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Long right) {", - " return (left.longValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Float right) {", - " return (left.longValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Double right) {", - " return (left.longValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Long, right : AtomicInteger) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicInteger right) {", - " return (left.longValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Long, right : AtomicLong) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicLong right) {", - " return (left.longValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long, right : AtomicDouble) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicDouble right) {", - " return (left.longValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final byte right) {", - " return (left.longValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final short right) {", - " return (left.longValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : int) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final int right) {", - " return (left.longValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final long right) {", - " return (left.longValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final float right) {", - " return (left.longValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final double right) {", - " return (left.longValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Byte right) {", - " return (left.longValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Short right) {", - " return (left.longValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Integer) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Integer right) {", - " return (left.longValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Long right) {", - " return (left.longValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Float right) {", - " return (left.longValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Double right) {", - " return (left.longValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Long, right : AtomicInteger) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicInteger right) {", - " return (left.longValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Long, right : AtomicLong) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicLong right) {", - " return (left.longValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long, right : AtomicDouble) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicDouble right) {", - " return (left.longValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final byte right) {", - " return (left != null && (left.longValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final short right) {", - " return (left != null && (left.longValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : int) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final int right) {", - " return (left != null && (left.longValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final long right) {", - " return (left != null && (left.longValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final float right) {", - " return (left != null && (left.longValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final double right) {", - " return (left != null && (left.longValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Byte right) {", - " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Short right) {", - " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Integer) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Integer right) {", - " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Long right) {", - " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Float right) {", - " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Double right) {", - " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Long, right : AtomicInteger) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicInteger right) {", - " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Long, right : AtomicLong) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicLong right) {", - " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long, right : AtomicDouble) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicDouble right) {", - " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_notEquals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final byte right) {", - " return (left == null || (left.longValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final short right) {", - " return (left == null || (left.longValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : int) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final int right) {", - " return (left == null || (left.longValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final long right) {", - " return (left == null || (left.longValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final float right) {", - " return (left == null || (left.longValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final double right) {", - " return (left == null || (left.longValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Byte right) {", - " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Short right) {", - " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Integer) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Integer right) {", - " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Long right) {", - " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Float right) {", - " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final Double right) {", - " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Long, right : AtomicInteger) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicInteger right) {", - " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Long, right : AtomicLong) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicLong right) {", - " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long, right : AtomicDouble) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Long left, final AtomicDouble right) {", - " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final byte right) {", - " return Long.compare(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final short right) {", - " return Long.compare(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : int) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final int right) {", - " return Long.compare(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final long right) {", - " return Long.compare(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final float right) {", - " return Float.compare(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final double right) {", - " return Double.compare(left.longValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final Byte right) {", - " return Long.compare(left.longValue(), right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final Short right) {", - " return Long.compare(left.longValue(), right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Integer) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final Integer right) {", - " return Long.compare(left.longValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final Long right) {", - " return Long.compare(left.longValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final Float right) {", - " return Float.compare(left.longValue(), right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Long, right : Double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final Double right) {", - " return Double.compare(left.longValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Long, right : AtomicInteger) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final AtomicInteger right) {", - " return Long.compare(left.longValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Long, right : AtomicLong) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final AtomicLong right) {", - " return Long.compare(left.longValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Long, right : AtomicDouble) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Long left, final AtomicDouble right) {", - " return Double.compare(left.longValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/NumberComparisonExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/NumberComparisonExtensionsTest.java deleted file mode 100644 index 1dec54b8c0..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/NumberComparisonExtensionsTest.java +++ /dev/null @@ -1,3525 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison; - -import static io.sarl.lang.scoping.extensions.numbers.comparison.NumberComparisonExtensions.*; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - NumberComparisonExtensionsTest.Code.class, - NumberComparisonExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class NumberComparisonExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Number left = new AtomicDouble(4.); - - private static Number left2 = new AtomicDouble(2.); - - private static int right = 3; - - private static int right2 = 5; - - @Test - public void operator_greaterEqualsThan_Byte_Number() { - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left.doubleValue()))); - } - - @Test - public void operator_lessEqualsThan_Byte_Number() { - assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left.doubleValue()))); - } - - @Test - public void operator_greaterThan_Byte_Number() { - assertTrue(operator_greaterThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left, new AtomicDouble(left.doubleValue()))); - } - - @Test - public void operator_lessThan_Byte_Number() { - assertFalse(operator_lessThan(left, new AtomicDouble(right))); - assertTrue(operator_lessThan(left2, new AtomicDouble(right))); - assertFalse(operator_lessThan(left, new AtomicDouble(left.doubleValue()))); - } - - @Test - public void operator_equals_Byte_Number() { - assertFalse(operator_equals(left, new AtomicDouble(right))); - assertFalse(operator_equals(left2, new AtomicDouble(right))); - assertTrue(operator_equals(left, new AtomicDouble(left.doubleValue()))); - } - - @Test - public void operator_notEquals_Byte_Number() { - assertTrue(operator_notEquals(left, new AtomicDouble(right))); - assertTrue(operator_notEquals(left2, new AtomicDouble(right))); - assertFalse(operator_notEquals(left, new AtomicDouble(left.doubleValue()))); - } - - @Test - public void operator_spaceship_Byte_byte() { - assertStrictlyPositive(operator_spaceship(left, (byte) right)); - assertStrictlyNegative(operator_spaceship(left, (byte) right2)); - assertZero(operator_spaceship(left, left.byteValue())); - } - - @Test - public void operator_spaceship_Byte_short() { - assertStrictlyPositive(operator_spaceship(left, (short) right)); - assertStrictlyNegative(operator_spaceship(left, (short) right2)); - assertZero(operator_spaceship(left, (short) left.doubleValue())); - } - - @Test - public void operator_spaceship_Byte_int() { - assertStrictlyPositive(operator_spaceship(left, (int) right)); - assertStrictlyNegative(operator_spaceship(left, (int) right2)); - assertZero(operator_spaceship(left, (int) left.doubleValue())); - } - - @Test - public void operator_spaceship_Byte_long() { - assertStrictlyPositive(operator_spaceship(left, (long) right)); - assertStrictlyNegative(operator_spaceship(left, (long) right2)); - assertZero(operator_spaceship(left, (long) left.longValue())); - } - - @Test - public void operator_spaceship_Byte_float() { - assertStrictlyPositive(operator_spaceship(left, (float) right)); - assertStrictlyNegative(operator_spaceship(left, (float) right2)); - assertZero(operator_spaceship(left, (float) left.floatValue())); - } - - @Test - public void operator_spaceship_Byte_double() { - assertStrictlyPositive(operator_spaceship(left, (double) right)); - assertStrictlyNegative(operator_spaceship(left, (double) right2)); - assertZero(operator_spaceship(left, (double) left.doubleValue())); - } - - @Test - public void operator_spaceship_Byte_Byte() { - assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); - assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); - assertZero(operator_spaceship(left, Byte.valueOf(left.byteValue()))); - } - - @Test - public void operator_spaceship_Byte_Short() { - assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); - assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); - assertZero(operator_spaceship(left, Short.valueOf((short) left.doubleValue()))); - } - - @Test - public void operator_spaceship_Byte_Integer() { - assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); - assertZero(operator_spaceship(left, Integer.valueOf(left.intValue()))); - } - - @Test - public void operator_spaceship_Byte_Long() { - assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); - assertZero(operator_spaceship(left, Long.valueOf(left.longValue()))); - } - - @Test - public void operator_spaceship_Byte_Float() { - assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); - assertZero(operator_spaceship(left, Float.valueOf(left.floatValue()))); - } - - @Test - public void operator_spaceship_Byte_Double() { - assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); - assertZero(operator_spaceship(left, Double.valueOf(left.doubleValue()))); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() { - assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); - assertZero(operator_spaceship(left, new AtomicInteger(left.intValue()))); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() { - assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); - assertZero(operator_spaceship(left, new AtomicLong(left.longValue()))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_greaterThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final byte right) {", - " return (left.doubleValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final short right) {", - " return (left.doubleValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : int) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final int right) {", - " return (left.doubleValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final long right) {", - " return (left.doubleValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final float right) {", - " return (left.doubleValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final double right) {", - " return (left.doubleValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Byte right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Short right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Integer) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Integer right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Long right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Float right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Double right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_greaterThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Number, right : AtomicInteger) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicInteger right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Number, right : AtomicLong) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicLong right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number, right : AtomicDouble) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicDouble right) {", - " return (left.doubleValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final byte right) {", - " return (left.doubleValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final short right) {", - " return (left.doubleValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : int) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final int right) {", - " return (left.doubleValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final long right) {", - " return (left.doubleValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final float right) {", - " return (left.doubleValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final double right) {", - " return (left.doubleValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Byte right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Short right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Integer) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Integer right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Long right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Float right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Double right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Number, right : AtomicInteger) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicInteger right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Number, right : AtomicLong) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicLong right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number, right : AtomicDouble) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicDouble right) {", - " return (left.doubleValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final byte right) {", - " return (left.doubleValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final short right) {", - " return (left.doubleValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : int) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final int right) {", - " return (left.doubleValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final long right) {", - " return (left.doubleValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final float right) {", - " return (left.doubleValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final double right) {", - " return (left.doubleValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Byte right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Short right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Integer) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Integer right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Long right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Float right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Double right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Number, right : AtomicInteger) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicInteger right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Number, right : AtomicLong) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicLong right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number, right : AtomicDouble) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicDouble right) {", - " return (left.doubleValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final byte right) {", - " return (left.doubleValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final short right) {", - " return (left.doubleValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : int) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final int right) {", - " return (left.doubleValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final long right) {", - " return (left.doubleValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final float right) {", - " return (left.doubleValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final double right) {", - " return (left.doubleValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Byte right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Short right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Integer) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Integer right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Long right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Float right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Double right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Number, right : AtomicInteger) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicInteger right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Number, right : AtomicLong) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicLong right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number, right : AtomicDouble) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicDouble right) {", - " return (left.doubleValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final byte right) {", - " return (left != null && (left.doubleValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final short right) {", - " return (left != null && (left.doubleValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : int) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final int right) {", - " return (left != null && (left.doubleValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final long right) {", - " return (left != null && (left.doubleValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final float right) {", - " return (left != null && (left.doubleValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final double right) {", - " return (left != null && (left.doubleValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Byte right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Short right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Integer) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Integer right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Long right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Float right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Double right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Number, right : AtomicInteger) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicInteger right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Number, right : AtomicLong) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicLong right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number, right : AtomicDouble) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicDouble right) {", - " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_notEquals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final byte right) {", - " return (left == null || (left.doubleValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final short right) {", - " return (left == null || (left.doubleValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : int) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final int right) {", - " return (left == null || (left.doubleValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final long right) {", - " return (left == null || (left.doubleValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final float right) {", - " return (left == null || (left.doubleValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final double right) {", - " return (left == null || (left.doubleValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Byte right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Short right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Integer) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Integer right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Long right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Float right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final Double right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Number, right : AtomicInteger) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicInteger right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Number, right : AtomicLong) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicLong right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number, right : AtomicDouble) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Number left, final AtomicDouble right) {", - " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final byte right) {", - " return Double.compare(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final short right) {", - " return Double.compare(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : int) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final int right) {", - " return Double.compare(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final long right) {", - " return Double.compare(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final float right) {", - " return Double.compare(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final double right) {", - " return Double.compare(left.doubleValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final Byte right) {", - " return Double.compare(left.doubleValue(), right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final Short right) {", - " return Double.compare(left.doubleValue(), right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Integer) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final Integer right) {", - " return Double.compare(left.doubleValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final Long right) {", - " return Double.compare(left.doubleValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final Float right) {", - " return Double.compare(left.doubleValue(), right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Number, right : Double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final Double right) {", - " return Double.compare(left.doubleValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Number, right : AtomicInteger) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final AtomicInteger right) {", - " return Double.compare(left.doubleValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Number, right : AtomicLong) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final AtomicLong right) {", - " return Double.compare(left.doubleValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Number, right : AtomicDouble) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Number left, final AtomicDouble right) {", - " return Double.compare(left.doubleValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveByteComparisonExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveByteComparisonExtensionsTest.java deleted file mode 100644 index 175afdade0..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveByteComparisonExtensionsTest.java +++ /dev/null @@ -1,3531 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison; - -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_equals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_greaterEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_greaterThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_lessEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_lessThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_notEquals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_spaceship; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveByteComparisonExtensionsTest.Code.class, - PrimitiveByteComparisonExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveByteComparisonExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static byte left = 4; - - private static byte left2 = 2; - - private static int right = 3; - - private static int right2 = 5; - - @Test - public void operator_greaterEqualsThan_byte_Number() { - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessEqualsThan_byte_Number() { - assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_greaterThan_byte_Number() { - assertTrue(operator_greaterThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessThan_byte_Number() { - assertFalse(operator_lessThan(left, new AtomicDouble(right))); - assertTrue(operator_lessThan(left2, new AtomicDouble(right))); - assertFalse(operator_lessThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_equals_byte_Number() { - assertFalse(operator_equals(left, new AtomicDouble(right))); - assertFalse(operator_equals(left2, new AtomicDouble(right))); - assertTrue(operator_equals(left, new AtomicDouble(left))); - } - - @Test - public void operator_notEquals_byte_Number() { - assertTrue(operator_notEquals(left, new AtomicDouble(right))); - assertTrue(operator_notEquals(left2, new AtomicDouble(right))); - assertFalse(operator_notEquals(left, new AtomicDouble(left))); - } - - @Test - public void operator_spaceship_byte_byte() { - assertStrictlyPositive(operator_spaceship(left, (byte) right)); - assertStrictlyNegative(operator_spaceship(left, (byte) right2)); - assertZero(operator_spaceship(left, (byte) left)); - } - - @Test - public void operator_spaceship_byte_short() { - assertStrictlyPositive(operator_spaceship(left, (short) right)); - assertStrictlyNegative(operator_spaceship(left, (short) right2)); - assertZero(operator_spaceship(left, (short) left)); - } - - @Test - public void operator_spaceship_byte_int() { - assertStrictlyPositive(operator_spaceship(left, (int) right)); - assertStrictlyNegative(operator_spaceship(left, (int) right2)); - assertZero(operator_spaceship(left, (int) left)); - } - - @Test - public void operator_spaceship_byte_long() { - assertStrictlyPositive(operator_spaceship(left, (long) right)); - assertStrictlyNegative(operator_spaceship(left, (long) right2)); - assertZero(operator_spaceship(left, (long) left)); - } - - @Test - public void operator_spaceship_byte_float() { - assertStrictlyPositive(operator_spaceship(left, (float) right)); - assertStrictlyNegative(operator_spaceship(left, (float) right2)); - assertZero(operator_spaceship(left, (float) left)); - } - - @Test - public void operator_spaceship_byte_double() { - assertStrictlyPositive(operator_spaceship(left, (double) right)); - assertStrictlyNegative(operator_spaceship(left, (double) right2)); - assertZero(operator_spaceship(left, (double) left)); - } - - @Test - public void operator_spaceship_byte_Byte() { - assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); - assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); - assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); - } - - @Test - public void operator_spaceship_byte_Short() { - assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); - assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); - assertZero(operator_spaceship(left, Short.valueOf((short) left))); - } - - @Test - public void operator_spaceship_byte_Integer() { - assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); - assertZero(operator_spaceship(left, Integer.valueOf(left))); - } - - @Test - public void operator_spaceship_byte_Long() { - assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); - assertZero(operator_spaceship(left, Long.valueOf(left))); - } - - @Test - public void operator_spaceship_byte_Float() { - assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); - assertZero(operator_spaceship(left, Float.valueOf(left))); - } - - @Test - public void operator_spaceship_byte_Double() { - assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); - assertZero(operator_spaceship(left, Double.valueOf(left))); - } - - @Test - public void operator_spaceship_byte_AtomicInteger() { - assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); - assertZero(operator_spaceship(left, new AtomicInteger(left))); - } - - @Test - public void operator_spaceship_byte_AtomicLong() { - assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); - assertZero(operator_spaceship(left, new AtomicLong(left))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_greaterThan_byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final byte right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final short right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : int) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final int right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final long right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final float right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final double right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Byte right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Short right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Integer) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Integer right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Long right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Float right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Double right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_greaterThan_byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : byte, right : AtomicInteger) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicInteger right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : byte, right : AtomicLong) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicLong right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte, right : AtomicDouble) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicDouble right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final byte right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final short right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : int) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final int right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final long right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final float right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final double right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Byte right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Short right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Integer) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Integer right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Long right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Float right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Double right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : byte, right : AtomicInteger) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicInteger right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : byte, right : AtomicLong) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicLong right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte, right : AtomicDouble) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicDouble right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final byte right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final short right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : int) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final int right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final long right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final float right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final double right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Byte right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Short right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Integer) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Integer right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Long right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Float right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Double right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : byte, right : AtomicInteger) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicInteger right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : byte, right : AtomicLong) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicLong right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte, right : AtomicDouble) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicDouble right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final byte right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final short right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : int) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final int right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final long right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final float right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final double right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Byte right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Short right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Integer) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Integer right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Long right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Float right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Double right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : byte, right : AtomicInteger) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicInteger right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : byte, right : AtomicLong) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicLong right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte, right : AtomicDouble) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicDouble right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final byte right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final short right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : int) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final int right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final long right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final float right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final double right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Byte right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Short right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Integer) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Integer right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Long right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Float right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Double right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : byte, right : AtomicInteger) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicInteger right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : byte, right : AtomicLong) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicLong right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte, right : AtomicDouble) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicDouble right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_notEquals_byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final byte right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final short right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : int) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final int right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final long right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final float right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final double right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Byte right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Short right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Integer) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Integer right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Long right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Float right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final Double right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : byte, right : AtomicInteger) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicInteger right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : byte, right : AtomicLong) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicLong right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte, right : AtomicDouble) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final byte left, final AtomicDouble right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final byte right) {", - " return Byte.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final short right) {", - " return Short.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : int) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final int right) {", - " return Integer.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final long right) {", - " return Long.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final float right) {", - " return Float.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final double right) {", - " return Double.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Byte right) {", - " return Byte.compare(left, right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Short right) {", - " return Short.compare(left, right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Integer) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Integer right) {", - " return Integer.compare(left, right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Long right) {", - " return Long.compare(left, right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Float right) {", - " return Float.compare(left, right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : byte, right : Double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final Double right) {", - " return Double.compare(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : byte, right : AtomicInteger) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final AtomicInteger right) {", - " return Integer.compare(left, right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : byte, right : AtomicLong) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final AtomicLong right) {", - " return Long.compare(left, right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : byte, right : AtomicDouble) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final byte left, final AtomicDouble right) {", - " return Double.compare(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveDoubleComparisonExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveDoubleComparisonExtensionsTest.java deleted file mode 100644 index 72886078ab..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveDoubleComparisonExtensionsTest.java +++ /dev/null @@ -1,3531 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison; - -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_equals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_greaterEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_greaterThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_lessEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_lessThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_notEquals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_spaceship; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveDoubleComparisonExtensionsTest.Code.class, - PrimitiveDoubleComparisonExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveDoubleComparisonExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static double left = 4; - - private static double left2 = 2; - - private static int right = 3; - - private static int right2 = 5; - - @Test - public void operator_greaterEqualsThan_double_Number() { - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessEqualsThan_double_Number() { - assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_greaterThan_double_Number() { - assertTrue(operator_greaterThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessThan_double_Number() { - assertFalse(operator_lessThan(left, new AtomicDouble(right))); - assertTrue(operator_lessThan(left2, new AtomicDouble(right))); - assertFalse(operator_lessThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_equals_double_Number() { - assertFalse(operator_equals(left, new AtomicDouble(right))); - assertFalse(operator_equals(left2, new AtomicDouble(right))); - assertTrue(operator_equals(left, new AtomicDouble(left))); - } - - @Test - public void operator_notEquals_double_Number() { - assertTrue(operator_notEquals(left, new AtomicDouble(right))); - assertTrue(operator_notEquals(left2, new AtomicDouble(right))); - assertFalse(operator_notEquals(left, new AtomicDouble(left))); - } - - @Test - public void operator_spaceship_double_byte() { - assertStrictlyPositive(operator_spaceship(left, (byte) right)); - assertStrictlyNegative(operator_spaceship(left, (byte) right2)); - assertZero(operator_spaceship(left, (byte) left)); - } - - @Test - public void operator_spaceship_double_short() { - assertStrictlyPositive(operator_spaceship(left, (short) right)); - assertStrictlyNegative(operator_spaceship(left, (short) right2)); - assertZero(operator_spaceship(left, (short) left)); - } - - @Test - public void operator_spaceship_double_int() { - assertStrictlyPositive(operator_spaceship(left, (int) right)); - assertStrictlyNegative(operator_spaceship(left, (int) right2)); - assertZero(operator_spaceship(left, (int) left)); - } - - @Test - public void operator_spaceship_double_long() { - assertStrictlyPositive(operator_spaceship(left, (long) right)); - assertStrictlyNegative(operator_spaceship(left, (long) right2)); - assertZero(operator_spaceship(left, (long) left)); - } - - @Test - public void operator_spaceship_double_float() { - assertStrictlyPositive(operator_spaceship(left, (float) right)); - assertStrictlyNegative(operator_spaceship(left, (float) right2)); - assertZero(operator_spaceship(left, (float) left)); - } - - @Test - public void operator_spaceship_double_double() { - assertStrictlyPositive(operator_spaceship(left, (double) right)); - assertStrictlyNegative(operator_spaceship(left, (double) right2)); - assertZero(operator_spaceship(left, (double) left)); - } - - @Test - public void operator_spaceship_double_Byte() { - assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); - assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); - assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); - } - - @Test - public void operator_spaceship_double_Short() { - assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); - assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); - assertZero(operator_spaceship(left, Short.valueOf((short) left))); - } - - @Test - public void operator_spaceship_double_Integer() { - assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); - assertZero(operator_spaceship(left, Integer.valueOf((int) left))); - } - - @Test - public void operator_spaceship_double_Long() { - assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); - assertZero(operator_spaceship(left, Long.valueOf((long) left))); - } - - @Test - public void operator_spaceship_double_Float() { - assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); - assertZero(operator_spaceship(left, Float.valueOf((float) left))); - } - - @Test - public void operator_spaceship_double_Double() { - assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); - assertZero(operator_spaceship(left, Double.valueOf(left))); - } - - @Test - public void operator_spaceship_double_AtomicInteger() { - assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); - assertZero(operator_spaceship(left, new AtomicInteger((int) left))); - } - - @Test - public void operator_spaceship_double_AtomicLong() { - assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); - assertZero(operator_spaceship(left, new AtomicLong((long) left))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_greaterThan_double_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final byte right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_double_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final short right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_double_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : int) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final int right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_double_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final long right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_double_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final float right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_double_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final double right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Byte right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Short right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Integer) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Integer right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Long right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Float right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_double_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Double right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_greaterThan_double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : double, right : AtomicInteger) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicInteger right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : double, right : AtomicLong) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicLong right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double, right : AtomicDouble) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicDouble right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final byte right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final short right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : int) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final int right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final long right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final float right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final double right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Byte right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Short right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Integer) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Integer right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Long right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Float right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Double right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : double, right : AtomicInteger) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicInteger right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : double, right : AtomicLong) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicLong right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double, right : AtomicDouble) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicDouble right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final byte right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final short right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : int) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final int right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final long right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final float right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final double right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Byte right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Short right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Integer) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Integer right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Long right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Float right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Double right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : double, right : AtomicInteger) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicInteger right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : double, right : AtomicLong) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicLong right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double, right : AtomicDouble) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicDouble right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final byte right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final short right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : int) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final int right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final long right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final float right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final double right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Byte right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Short right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Integer) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Integer right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Long right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Float right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Double right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : double, right : AtomicInteger) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicInteger right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : double, right : AtomicLong) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicLong right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double, right : AtomicDouble) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicDouble right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final byte right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final short right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : int) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final int right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final long right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final float right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final double right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Byte right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Short right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Integer) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Integer right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Long right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Float right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Double right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : double, right : AtomicInteger) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicInteger right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : double, right : AtomicLong) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicLong right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double, right : AtomicDouble) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicDouble right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_notEquals_double_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final byte right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final short right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : int) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final int right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final long right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final float right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final double right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Byte right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Short right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Integer) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Integer right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Long right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Float right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final Double right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : double, right : AtomicInteger) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicInteger right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : double, right : AtomicLong) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicLong right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double, right : AtomicDouble) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final double left, final AtomicDouble right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final byte right) {", - " return Double.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final short right) {", - " return Double.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : int) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final int right) {", - " return Double.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final long right) {", - " return Double.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final float right) {", - " return Double.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final double right) {", - " return Double.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final Byte right) {", - " return Double.compare(left, right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final Short right) {", - " return Double.compare(left, right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Integer) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final Integer right) {", - " return Double.compare(left, right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final Long right) {", - " return Double.compare(left, right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final Float right) {", - " return Double.compare(left, right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : double, right : Double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final Double right) {", - " return Double.compare(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : double, right : AtomicInteger) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final AtomicInteger right) {", - " return Double.compare(left, right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : double, right : AtomicLong) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final AtomicLong right) {", - " return Double.compare(left, right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_double_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : double, right : AtomicDouble) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final double left, final AtomicDouble right) {", - " return Double.compare(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveFloatComparisonExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveFloatComparisonExtensionsTest.java deleted file mode 100644 index db2d942d6d..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveFloatComparisonExtensionsTest.java +++ /dev/null @@ -1,3531 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison; - -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_equals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_greaterEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_greaterThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_lessEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_lessThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_notEquals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_spaceship; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveFloatComparisonExtensionsTest.Code.class, - PrimitiveFloatComparisonExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveFloatComparisonExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static float left = 4; - - private static float left2 = 2; - - private static int right = 3; - - private static int right2 = 5; - - @Test - public void operator_greaterEqualsThan_short_Number() { - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessEqualsThan_short_Number() { - assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_greaterThan_short_Number() { - assertTrue(operator_greaterThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessThan_short_Number() { - assertFalse(operator_lessThan(left, new AtomicDouble(right))); - assertTrue(operator_lessThan(left2, new AtomicDouble(right))); - assertFalse(operator_lessThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_equals_short_Number() { - assertFalse(operator_equals(left, new AtomicDouble(right))); - assertFalse(operator_equals(left2, new AtomicDouble(right))); - assertTrue(operator_equals(left, new AtomicDouble(left))); - } - - @Test - public void operator_notEquals_short_Number() { - assertTrue(operator_notEquals(left, new AtomicDouble(right))); - assertTrue(operator_notEquals(left2, new AtomicDouble(right))); - assertFalse(operator_notEquals(left, new AtomicDouble(left))); - } - - @Test - public void operator_spaceship_short_byte() { - assertStrictlyPositive(operator_spaceship(left, (byte) right)); - assertStrictlyNegative(operator_spaceship(left, (byte) right2)); - assertZero(operator_spaceship(left, (byte) left)); - } - - @Test - public void operator_spaceship_short_short() { - assertStrictlyPositive(operator_spaceship(left, (short) right)); - assertStrictlyNegative(operator_spaceship(left, (short) right2)); - assertZero(operator_spaceship(left, (short) left)); - } - - @Test - public void operator_spaceship_short_int() { - assertStrictlyPositive(operator_spaceship(left, (int) right)); - assertStrictlyNegative(operator_spaceship(left, (int) right2)); - assertZero(operator_spaceship(left, (int) left)); - } - - @Test - public void operator_spaceship_short_long() { - assertStrictlyPositive(operator_spaceship(left, (long) right)); - assertStrictlyNegative(operator_spaceship(left, (long) right2)); - assertZero(operator_spaceship(left, (long) left)); - } - - @Test - public void operator_spaceship_short_float() { - assertStrictlyPositive(operator_spaceship(left, (float) right)); - assertStrictlyNegative(operator_spaceship(left, (float) right2)); - assertZero(operator_spaceship(left, (float) left)); - } - - @Test - public void operator_spaceship_short_double() { - assertStrictlyPositive(operator_spaceship(left, (double) right)); - assertStrictlyNegative(operator_spaceship(left, (double) right2)); - assertZero(operator_spaceship(left, (double) left)); - } - - @Test - public void operator_spaceship_short_Byte() { - assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); - assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); - assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); - } - - @Test - public void operator_spaceship_short_Short() { - assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); - assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); - assertZero(operator_spaceship(left, Short.valueOf((short) left))); - } - - @Test - public void operator_spaceship_short_Integer() { - assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); - assertZero(operator_spaceship(left, Integer.valueOf((int) left))); - } - - @Test - public void operator_spaceship_short_Long() { - assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); - assertZero(operator_spaceship(left, Long.valueOf((long) left))); - } - - @Test - public void operator_spaceship_short_Float() { - assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); - assertZero(operator_spaceship(left, Float.valueOf(left))); - } - - @Test - public void operator_spaceship_short_Double() { - assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); - assertZero(operator_spaceship(left, Double.valueOf(left))); - } - - @Test - public void operator_spaceship_short_AtomicInteger() { - assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); - assertZero(operator_spaceship(left, new AtomicInteger((int) left))); - } - - @Test - public void operator_spaceship_short_AtomicLong() { - assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); - assertZero(operator_spaceship(left, new AtomicLong((long) left))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_greaterThan_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final byte right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final short right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : int) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final int right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final long right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final float right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final double right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Byte right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Short right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Integer) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Integer right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Long right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Float right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Double right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_greaterThan_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : float, right : AtomicInteger) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicInteger right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : float, right : AtomicLong) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicLong right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float, right : AtomicDouble) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicDouble right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final byte right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final short right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : int) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final int right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final long right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final float right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final double right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Byte right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Short right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Integer) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Integer right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Long right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Float right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Double right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : float, right : AtomicInteger) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicInteger right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : float, right : AtomicLong) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicLong right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float, right : AtomicDouble) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicDouble right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final byte right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final short right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : int) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final int right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final long right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final float right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final double right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Byte right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Short right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Integer) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Integer right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Long right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Float right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Double right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : float, right : AtomicInteger) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicInteger right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : float, right : AtomicLong) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicLong right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float, right : AtomicDouble) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicDouble right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final byte right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final short right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : int) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final int right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final long right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final float right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final double right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Byte right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Short right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Integer) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Integer right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Long right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Float right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Double right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : float, right : AtomicInteger) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicInteger right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : float, right : AtomicLong) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicLong right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float, right : AtomicDouble) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicDouble right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final byte right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final short right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : int) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final int right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final long right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final float right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final double right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Byte right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Short right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Integer) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Integer right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Long right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Float right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Double right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : float, right : AtomicInteger) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicInteger right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : float, right : AtomicLong) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicLong right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float, right : AtomicDouble) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicDouble right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_notEquals_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final byte right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final short right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : int) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final int right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final long right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final float right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final double right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Byte right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Short right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Integer) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Integer right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Long right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Float right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final Double right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : float, right : AtomicInteger) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicInteger right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : float, right : AtomicLong) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicLong right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float, right : AtomicDouble) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final float left, final AtomicDouble right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final byte right) {", - " return Float.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final short right) {", - " return Float.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : int) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final int right) {", - " return Float.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final long right) {", - " return Float.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final float right) {", - " return Float.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final double right) {", - " return Double.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final Byte right) {", - " return Float.compare(left, right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final Short right) {", - " return Float.compare(left, right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Integer) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final Integer right) {", - " return Float.compare(left, right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final Long right) {", - " return Float.compare(left, right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final Float right) {", - " return Float.compare(left, right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : float, right : Double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final Double right) {", - " return Double.compare(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : float, right : AtomicInteger) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final AtomicInteger right) {", - " return Float.compare(left, right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : float, right : AtomicLong) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final AtomicLong right) {", - " return Float.compare(left, right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : float, right : AtomicDouble) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final float left, final AtomicDouble right) {", - " return Double.compare(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveIntComparisonExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveIntComparisonExtensionsTest.java deleted file mode 100644 index 9cdab73b06..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveIntComparisonExtensionsTest.java +++ /dev/null @@ -1,3531 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison; - -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_equals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_greaterEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_greaterThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_lessEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_lessThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_notEquals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_spaceship; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveIntComparisonExtensionsTest.Code.class, - PrimitiveIntComparisonExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveIntComparisonExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static int left = 4; - - private static int left2 = 2; - - private static int right = 3; - - private static int right2 = 5; - - @Test - public void operator_greaterEqualsThan_int_Number() { - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessEqualsThan_int_Number() { - assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_greaterThan_int_Number() { - assertTrue(operator_greaterThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessThan_int_Number() { - assertFalse(operator_lessThan(left, new AtomicDouble(right))); - assertTrue(operator_lessThan(left2, new AtomicDouble(right))); - assertFalse(operator_lessThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_equals_int_Number() { - assertFalse(operator_equals(left, new AtomicDouble(right))); - assertFalse(operator_equals(left2, new AtomicDouble(right))); - assertTrue(operator_equals(left, new AtomicDouble(left))); - } - - @Test - public void operator_notEquals_int_Number() { - assertTrue(operator_notEquals(left, new AtomicDouble(right))); - assertTrue(operator_notEquals(left2, new AtomicDouble(right))); - assertFalse(operator_notEquals(left, new AtomicDouble(left))); - } - - @Test - public void operator_spaceship_int_byte() { - assertStrictlyPositive(operator_spaceship(left, (byte) right)); - assertStrictlyNegative(operator_spaceship(left, (byte) right2)); - assertZero(operator_spaceship(left, (byte) left)); - } - - @Test - public void operator_spaceship_int_short() { - assertStrictlyPositive(operator_spaceship(left, (short) right)); - assertStrictlyNegative(operator_spaceship(left, (short) right2)); - assertZero(operator_spaceship(left, (short) left)); - } - - @Test - public void operator_spaceship_int_int() { - assertStrictlyPositive(operator_spaceship(left, (int) right)); - assertStrictlyNegative(operator_spaceship(left, (int) right2)); - assertZero(operator_spaceship(left, (int) left)); - } - - @Test - public void operator_spaceship_int_long() { - assertStrictlyPositive(operator_spaceship(left, (long) right)); - assertStrictlyNegative(operator_spaceship(left, (long) right2)); - assertZero(operator_spaceship(left, (long) left)); - } - - @Test - public void operator_spaceship_int_float() { - assertStrictlyPositive(operator_spaceship(left, (float) right)); - assertStrictlyNegative(operator_spaceship(left, (float) right2)); - assertZero(operator_spaceship(left, (float) left)); - } - - @Test - public void operator_spaceship_int_double() { - assertStrictlyPositive(operator_spaceship(left, (double) right)); - assertStrictlyNegative(operator_spaceship(left, (double) right2)); - assertZero(operator_spaceship(left, (double) left)); - } - - @Test - public void operator_spaceship_int_Byte() { - assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); - assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); - assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); - } - - @Test - public void operator_spaceship_int_Short() { - assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); - assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); - assertZero(operator_spaceship(left, Short.valueOf((short) left))); - } - - @Test - public void operator_spaceship_int_Integer() { - assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); - assertZero(operator_spaceship(left, Integer.valueOf(left))); - } - - @Test - public void operator_spaceship_int_Long() { - assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); - assertZero(operator_spaceship(left, Long.valueOf(left))); - } - - @Test - public void operator_spaceship_int_Float() { - assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); - assertZero(operator_spaceship(left, Float.valueOf(left))); - } - - @Test - public void operator_spaceship_int_Double() { - assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); - assertZero(operator_spaceship(left, Double.valueOf(left))); - } - - @Test - public void operator_spaceship_int_AtomicInteger() { - assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); - assertZero(operator_spaceship(left, new AtomicInteger(left))); - } - - @Test - public void operator_spaceship_int_AtomicLong() { - assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); - assertZero(operator_spaceship(left, new AtomicLong(left))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_greaterThan_int_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final byte right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_int_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final short right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_int_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : int) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final int right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_int_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final long right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_int_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final float right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_int_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final double right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_int_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Byte right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_int_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Short right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_int_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Integer) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Integer right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_int_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Long right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_int_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Float right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_int_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Double right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_greaterThan_int_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : int, right : AtomicInteger) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicInteger right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_int_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : int, right : AtomicLong) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicLong right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_int_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int, right : AtomicDouble) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicDouble right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final byte right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final short right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : int) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final int right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final long right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final float right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final double right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Byte right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Short right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Integer) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Integer right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Long right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Float right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Double right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : int, right : AtomicInteger) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicInteger right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : int, right : AtomicLong) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicLong right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_int_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int, right : AtomicDouble) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicDouble right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final byte right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final short right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : int) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final int right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final long right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final float right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final double right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Byte right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Short right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Integer) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Integer right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Long right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Float right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Double right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : int, right : AtomicInteger) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicInteger right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : int, right : AtomicLong) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicLong right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_int_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int, right : AtomicDouble) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicDouble right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final byte right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final short right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : int) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final int right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final long right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final float right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final double right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Byte right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Short right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Integer) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Integer right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Long right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Float right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Double right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : int, right : AtomicInteger) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicInteger right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : int, right : AtomicLong) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicLong right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_int_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int, right : AtomicDouble) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicDouble right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final byte right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final short right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : int) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final int right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final long right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final float right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final double right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Byte right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Short right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Integer) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Integer right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Long right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Float right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Double right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : int, right : AtomicInteger) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicInteger right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : int, right : AtomicLong) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicLong right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_int_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int, right : AtomicDouble) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicDouble right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_notEquals_int_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final byte right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final short right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : int) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final int right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final long right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final float right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final double right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Byte right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Short right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Integer) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Integer right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Long right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Float right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final Double right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : int, right : AtomicInteger) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicInteger right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : int, right : AtomicLong) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicLong right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_int_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int, right : AtomicDouble) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final int left, final AtomicDouble right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final byte right) {", - " return Integer.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final short right) {", - " return Integer.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : int) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final int right) {", - " return Integer.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final long right) {", - " return Long.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final float right) {", - " return Float.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final double right) {", - " return Double.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Byte right) {", - " return Integer.compare(left, right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Short right) {", - " return Integer.compare(left, right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Integer) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Integer right) {", - " return Integer.compare(left, right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Long right) {", - " return Long.compare(left, right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Float right) {", - " return Float.compare(left, right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : int, right : Double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final Double right) {", - " return Double.compare(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : int, right : AtomicInteger) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final AtomicInteger right) {", - " return Integer.compare(left, right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : int, right : AtomicLong) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final AtomicLong right) {", - " return Long.compare(left, right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_int_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : int, right : AtomicDouble) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final int left, final AtomicDouble right) {", - " return Double.compare(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveLongComparisonExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveLongComparisonExtensionsTest.java deleted file mode 100644 index 3bc3db44ee..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveLongComparisonExtensionsTest.java +++ /dev/null @@ -1,3531 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison; - -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_equals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_greaterEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_greaterThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_lessEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_lessThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_notEquals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_spaceship; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveLongComparisonExtensionsTest.Code.class, - PrimitiveLongComparisonExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveLongComparisonExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static short left = 4; - - private static short left2 = 2; - - private static int right = 3; - - private static int right2 = 5; - - @Test - public void operator_greaterEqualsThan_short_Number() { - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessEqualsThan_short_Number() { - assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_greaterThan_short_Number() { - assertTrue(operator_greaterThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessThan_short_Number() { - assertFalse(operator_lessThan(left, new AtomicDouble(right))); - assertTrue(operator_lessThan(left2, new AtomicDouble(right))); - assertFalse(operator_lessThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_equals_short_Number() { - assertFalse(operator_equals(left, new AtomicDouble(right))); - assertFalse(operator_equals(left2, new AtomicDouble(right))); - assertTrue(operator_equals(left, new AtomicDouble(left))); - } - - @Test - public void operator_notEquals_short_Number() { - assertTrue(operator_notEquals(left, new AtomicDouble(right))); - assertTrue(operator_notEquals(left2, new AtomicDouble(right))); - assertFalse(operator_notEquals(left, new AtomicDouble(left))); - } - - @Test - public void operator_spaceship_short_byte() { - assertStrictlyPositive(operator_spaceship(left, (byte) right)); - assertStrictlyNegative(operator_spaceship(left, (byte) right2)); - assertZero(operator_spaceship(left, (byte) left)); - } - - @Test - public void operator_spaceship_short_short() { - assertStrictlyPositive(operator_spaceship(left, (short) right)); - assertStrictlyNegative(operator_spaceship(left, (short) right2)); - assertZero(operator_spaceship(left, (short) left)); - } - - @Test - public void operator_spaceship_short_int() { - assertStrictlyPositive(operator_spaceship(left, (int) right)); - assertStrictlyNegative(operator_spaceship(left, (int) right2)); - assertZero(operator_spaceship(left, (int) left)); - } - - @Test - public void operator_spaceship_short_long() { - assertStrictlyPositive(operator_spaceship(left, (long) right)); - assertStrictlyNegative(operator_spaceship(left, (long) right2)); - assertZero(operator_spaceship(left, (long) left)); - } - - @Test - public void operator_spaceship_short_float() { - assertStrictlyPositive(operator_spaceship(left, (float) right)); - assertStrictlyNegative(operator_spaceship(left, (float) right2)); - assertZero(operator_spaceship(left, (float) left)); - } - - @Test - public void operator_spaceship_short_double() { - assertStrictlyPositive(operator_spaceship(left, (double) right)); - assertStrictlyNegative(operator_spaceship(left, (double) right2)); - assertZero(operator_spaceship(left, (double) left)); - } - - @Test - public void operator_spaceship_short_Byte() { - assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); - assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); - assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); - } - - @Test - public void operator_spaceship_short_Short() { - assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); - assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); - assertZero(operator_spaceship(left, Short.valueOf((short) left))); - } - - @Test - public void operator_spaceship_short_Integer() { - assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); - assertZero(operator_spaceship(left, Integer.valueOf(left))); - } - - @Test - public void operator_spaceship_short_Long() { - assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); - assertZero(operator_spaceship(left, Long.valueOf(left))); - } - - @Test - public void operator_spaceship_short_Float() { - assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); - assertZero(operator_spaceship(left, Float.valueOf(left))); - } - - @Test - public void operator_spaceship_short_Double() { - assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); - assertZero(operator_spaceship(left, Double.valueOf(left))); - } - - @Test - public void operator_spaceship_short_AtomicInteger() { - assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); - assertZero(operator_spaceship(left, new AtomicInteger(left))); - } - - @Test - public void operator_spaceship_short_AtomicLong() { - assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); - assertZero(operator_spaceship(left, new AtomicLong(left))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_greaterThan_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final byte right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final short right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final int right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final long right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final float right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final double right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Byte right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Short right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Integer right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Long right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Float right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Double right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_greaterThan_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicInteger right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicLong right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicDouble right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final byte right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final short right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final int right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final long right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final float right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final double right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Byte right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Short right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Integer right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Long right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Float right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Double right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicInteger right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicLong right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicDouble right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final byte right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final short right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final int right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final long right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final float right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final double right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Byte right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Short right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Integer right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Long right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Float right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Double right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicInteger right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicLong right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicDouble right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final byte right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final short right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final int right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final long right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final float right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final double right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Byte right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Short right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Integer right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Long right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Float right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Double right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicInteger right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicLong right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicDouble right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final byte right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final short right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final int right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final long right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final float right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final double right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Byte right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Short right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Integer right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Long right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Float right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Double right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicInteger right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicLong right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicDouble right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_notEquals_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final byte right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final short right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final int right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final long right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final float right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final double right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Byte right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Short right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Integer right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Long right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Float right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Double right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicInteger right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicLong right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicDouble right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final byte right) {", - " return Short.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final short right) {", - " return Short.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final int right) {", - " return Integer.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final long right) {", - " return Long.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final float right) {", - " return Float.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final double right) {", - " return Double.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Byte right) {", - " return Short.compare(left, right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Short right) {", - " return Short.compare(left, right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Integer right) {", - " return Integer.compare(left, right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Long right) {", - " return Long.compare(left, right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Float right) {", - " return Float.compare(left, right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Double right) {", - " return Double.compare(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final AtomicInteger right) {", - " return Integer.compare(left, right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final AtomicLong right) {", - " return Long.compare(left, right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final AtomicDouble right) {", - " return Double.compare(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveShortComparisonExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveShortComparisonExtensionsTest.java deleted file mode 100644 index 0ddd1c377d..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/PrimitiveShortComparisonExtensionsTest.java +++ /dev/null @@ -1,3531 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison; - -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_equals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_greaterEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_greaterThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_lessEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_lessThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_notEquals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_spaceship; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - PrimitiveShortComparisonExtensionsTest.Code.class, - PrimitiveShortComparisonExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class PrimitiveShortComparisonExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static short left = 4; - - private static short left2 = 2; - - private static int right = 3; - - private static int right2 = 5; - - @Test - public void operator_greaterEqualsThan_short_Number() { - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessEqualsThan_short_Number() { - assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_greaterThan_short_Number() { - assertTrue(operator_greaterThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessThan_short_Number() { - assertFalse(operator_lessThan(left, new AtomicDouble(right))); - assertTrue(operator_lessThan(left2, new AtomicDouble(right))); - assertFalse(operator_lessThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_equals_short_Number() { - assertFalse(operator_equals(left, new AtomicDouble(right))); - assertFalse(operator_equals(left2, new AtomicDouble(right))); - assertTrue(operator_equals(left, new AtomicDouble(left))); - } - - @Test - public void operator_notEquals_short_Number() { - assertTrue(operator_notEquals(left, new AtomicDouble(right))); - assertTrue(operator_notEquals(left2, new AtomicDouble(right))); - assertFalse(operator_notEquals(left, new AtomicDouble(left))); - } - - @Test - public void operator_spaceship_short_byte() { - assertStrictlyPositive(operator_spaceship(left, (byte) right)); - assertStrictlyNegative(operator_spaceship(left, (byte) right2)); - assertZero(operator_spaceship(left, (byte) left)); - } - - @Test - public void operator_spaceship_short_short() { - assertStrictlyPositive(operator_spaceship(left, (short) right)); - assertStrictlyNegative(operator_spaceship(left, (short) right2)); - assertZero(operator_spaceship(left, (short) left)); - } - - @Test - public void operator_spaceship_short_int() { - assertStrictlyPositive(operator_spaceship(left, (int) right)); - assertStrictlyNegative(operator_spaceship(left, (int) right2)); - assertZero(operator_spaceship(left, (int) left)); - } - - @Test - public void operator_spaceship_short_long() { - assertStrictlyPositive(operator_spaceship(left, (long) right)); - assertStrictlyNegative(operator_spaceship(left, (long) right2)); - assertZero(operator_spaceship(left, (long) left)); - } - - @Test - public void operator_spaceship_short_float() { - assertStrictlyPositive(operator_spaceship(left, (float) right)); - assertStrictlyNegative(operator_spaceship(left, (float) right2)); - assertZero(operator_spaceship(left, (float) left)); - } - - @Test - public void operator_spaceship_short_double() { - assertStrictlyPositive(operator_spaceship(left, (double) right)); - assertStrictlyNegative(operator_spaceship(left, (double) right2)); - assertZero(operator_spaceship(left, (double) left)); - } - - @Test - public void operator_spaceship_short_Byte() { - assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); - assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); - assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); - } - - @Test - public void operator_spaceship_short_Short() { - assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); - assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); - assertZero(operator_spaceship(left, Short.valueOf((short) left))); - } - - @Test - public void operator_spaceship_short_Integer() { - assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); - assertZero(operator_spaceship(left, Integer.valueOf(left))); - } - - @Test - public void operator_spaceship_short_Long() { - assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); - assertZero(operator_spaceship(left, Long.valueOf(left))); - } - - @Test - public void operator_spaceship_short_Float() { - assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); - assertZero(operator_spaceship(left, Float.valueOf(left))); - } - - @Test - public void operator_spaceship_short_Double() { - assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); - assertZero(operator_spaceship(left, Double.valueOf(left))); - } - - @Test - public void operator_spaceship_short_AtomicInteger() { - assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); - assertZero(operator_spaceship(left, new AtomicInteger(left))); - } - - @Test - public void operator_spaceship_short_AtomicLong() { - assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); - assertZero(operator_spaceship(left, new AtomicLong(left))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_greaterThan_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final byte right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final short right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final int right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final long right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final float right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final double right) {", - " return (left > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Byte right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Short right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Integer right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Long right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Float right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Double right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_greaterThan_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicInteger right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicLong right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicDouble right) {", - " return (left > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final byte right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final short right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final int right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final long right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final float right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final double right) {", - " return (left >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Byte right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Short right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Integer right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Long right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Float right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Double right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicInteger right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicLong right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicDouble right) {", - " return (left >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final byte right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final short right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final int right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final long right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final float right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final double right) {", - " return (left < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Byte right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Short right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Integer right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Long right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Float right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Double right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicInteger right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicLong right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicDouble right) {", - " return (left < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final byte right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final short right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final int right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final long right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final float right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final double right) {", - " return (left <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Byte right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Short right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Integer right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Long right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Float right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Double right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicInteger right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicLong right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicDouble right) {", - " return (left <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final byte right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final short right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final int right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final long right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final float right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final double right) {", - " return (left == right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Byte right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Short right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Integer right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Long right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Float right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Double right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicInteger right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicLong right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicDouble right) {", - " return (right != null && left == right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_notEquals_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final byte right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final short right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final int right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final long right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final float right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final double right) {", - " return (left != right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Byte right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Short right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Integer right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Long right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Float right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final Double right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicInteger right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicLong right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final short left, final AtomicDouble right) {", - " return (right == null || left != right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final byte right) {", - " return Short.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final short right) {", - " return Short.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : int) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final int right) {", - " return Integer.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final long right) {", - " return Long.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final float right) {", - " return Float.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final double right) {", - " return Double.compare(left, right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Byte right) {", - " return Short.compare(left, right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Short right) {", - " return Short.compare(left, right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Integer) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Integer right) {", - " return Integer.compare(left, right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Long right) {", - " return Long.compare(left, right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Float right) {", - " return Float.compare(left, right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : short, right : Double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final Double right) {", - " return Double.compare(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : short, right : AtomicInteger) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final AtomicInteger right) {", - " return Integer.compare(left, right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : short, right : AtomicLong) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final AtomicLong right) {", - " return Long.compare(left, right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_short_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : short, right : AtomicDouble) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final short left, final AtomicDouble right) {", - " return Double.compare(left, right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/ShortComparisonExtensionsTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/ShortComparisonExtensionsTest.java deleted file mode 100644 index fafa984fdd..0000000000 --- a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/ShortComparisonExtensionsTest.java +++ /dev/null @@ -1,3531 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2018 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison; - -import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_equals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_greaterEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_greaterThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_lessEqualsThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_lessThan; -import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_notEquals; -import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_spaceship; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; -import org.eclipse.xtext.xbase.testing.CompilationTestHelper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import io.sarl.lang.SARLVersion; -import io.sarl.lang.sarl.SarlPackage; -import io.sarl.tests.api.AbstractSarlTest; - -/** - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-extras/issues/186" - */ -@RunWith(Suite.class) -@SuiteClasses({ - ShortComparisonExtensionsTest.Code.class, - ShortComparisonExtensionsTest.Compilation.class -}) -@SuppressWarnings("all") -public class ShortComparisonExtensionsTest { - - /** This class tests the implementation of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Code extends AbstractSarlTest { - - private static Short left = 4; - - private static Short left2 = 2; - - private static int right = 3; - - private static int right2 = 5; - - @Test - public void operator_greaterEqualsThan_Byte_Number() { - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessEqualsThan_Byte_Number() { - assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); - assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_greaterThan_Byte_Number() { - assertTrue(operator_greaterThan(left, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); - assertFalse(operator_greaterThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_lessThan_Byte_Number() { - assertFalse(operator_lessThan(left, new AtomicDouble(right))); - assertTrue(operator_lessThan(left2, new AtomicDouble(right))); - assertFalse(operator_lessThan(left, new AtomicDouble(left))); - } - - @Test - public void operator_equals_Byte_Number() { - assertFalse(operator_equals(left, new AtomicDouble(right))); - assertFalse(operator_equals(left2, new AtomicDouble(right))); - assertTrue(operator_equals(left, new AtomicDouble(left))); - } - - @Test - public void operator_notEquals_Byte_Number() { - assertTrue(operator_notEquals(left, new AtomicDouble(right))); - assertTrue(operator_notEquals(left2, new AtomicDouble(right))); - assertFalse(operator_notEquals(left, new AtomicDouble(left))); - } - - @Test - public void operator_spaceship_Byte_byte() { - assertStrictlyPositive(operator_spaceship(left, (byte) right)); - assertStrictlyNegative(operator_spaceship(left, (byte) right2)); - assertZero(operator_spaceship(left, left.byteValue())); - } - - @Test - public void operator_spaceship_Byte_short() { - assertStrictlyPositive(operator_spaceship(left, (short) right)); - assertStrictlyNegative(operator_spaceship(left, (short) right2)); - assertZero(operator_spaceship(left, (short) left)); - } - - @Test - public void operator_spaceship_Byte_int() { - assertStrictlyPositive(operator_spaceship(left, (int) right)); - assertStrictlyNegative(operator_spaceship(left, (int) right2)); - assertZero(operator_spaceship(left, (int) left)); - } - - @Test - public void operator_spaceship_Byte_long() { - assertStrictlyPositive(operator_spaceship(left, (long) right)); - assertStrictlyNegative(operator_spaceship(left, (long) right2)); - assertZero(operator_spaceship(left, (long) left)); - } - - @Test - public void operator_spaceship_Byte_float() { - assertStrictlyPositive(operator_spaceship(left, (float) right)); - assertStrictlyNegative(operator_spaceship(left, (float) right2)); - assertZero(operator_spaceship(left, (float) left)); - } - - @Test - public void operator_spaceship_Byte_double() { - assertStrictlyPositive(operator_spaceship(left, (double) right)); - assertStrictlyNegative(operator_spaceship(left, (double) right2)); - assertZero(operator_spaceship(left, (double) left)); - } - - @Test - public void operator_spaceship_Byte_Byte() { - assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); - assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); - assertZero(operator_spaceship(left, Byte.valueOf(left.byteValue()))); - } - - @Test - public void operator_spaceship_Byte_Short() { - assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); - assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); - assertZero(operator_spaceship(left, Short.valueOf((short) left))); - } - - @Test - public void operator_spaceship_Byte_Integer() { - assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); - assertZero(operator_spaceship(left, Integer.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_Long() { - assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); - assertZero(operator_spaceship(left, Long.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_Float() { - assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); - assertZero(operator_spaceship(left, Float.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_Double() { - assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); - assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); - assertZero(operator_spaceship(left, Double.valueOf(left))); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() { - assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); - assertZero(operator_spaceship(left, new AtomicInteger(left))); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() { - assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); - assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); - assertZero(operator_spaceship(left, new AtomicLong(left))); - } - - } - - /** This class tests if the generated Java code corresponds to the inline definition of the functions. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - */ - public static class Compilation extends AbstractSarlTest { - - @Test - public void operator_greaterThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final byte right) {", - " return (left.shortValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final short right) {", - " return (left.shortValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : int) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final int right) {", - " return (left.shortValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final long right) {", - " return (left.shortValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final float right) {", - " return (left.shortValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final double right) {", - " return (left.shortValue() > right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Byte) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Byte right) {", - " return (left.shortValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Short) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Short right) {", - " return (left.shortValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Integer) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Integer right) {", - " return (left.shortValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Long) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Long right) {", - " return (left.shortValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Float) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Float right) {", - " return (left.shortValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Double) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Double right) {", - " return (left.shortValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_greaterThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Short, right : AtomicInteger) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicInteger right) {", - " return (left.shortValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Short, right : AtomicLong) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicLong right) {", - " return (left.shortValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short, right : AtomicDouble) : boolean {", - " left > right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicDouble right) {", - " return (left.shortValue() > right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final byte right) {", - " return (left.shortValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final short right) {", - " return (left.shortValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : int) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final int right) {", - " return (left.shortValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final long right) {", - " return (left.shortValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final float right) {", - " return (left.shortValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final double right) {", - " return (left.shortValue() >= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Byte) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Byte right) {", - " return (left.shortValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Short) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Short right) {", - " return (left.shortValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Integer) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Integer right) {", - " return (left.shortValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Long) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Long right) {", - " return (left.shortValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Float) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Float right) {", - " return (left.shortValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Double) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Double right) {", - " return (left.shortValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Short, right : AtomicInteger) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicInteger right) {", - " return (left.shortValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Short, right : AtomicLong) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicLong right) {", - " return (left.shortValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_greaterEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short, right : AtomicDouble) : boolean {", - " left >= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicDouble right) {", - " return (left.shortValue() >= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final byte right) {", - " return (left.shortValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final short right) {", - " return (left.shortValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : int) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final int right) {", - " return (left.shortValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final long right) {", - " return (left.shortValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final float right) {", - " return (left.shortValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final double right) {", - " return (left.shortValue() < right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Byte) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Byte right) {", - " return (left.shortValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Short) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Short right) {", - " return (left.shortValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Integer) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Integer right) {", - " return (left.shortValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Long) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Long right) {", - " return (left.shortValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Float) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Float right) {", - " return (left.shortValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Double) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Double right) {", - " return (left.shortValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Short, right : AtomicInteger) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicInteger right) {", - " return (left.shortValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Short, right : AtomicLong) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicLong right) {", - " return (left.shortValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short, right : AtomicDouble) : boolean {", - " left < right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicDouble right) {", - " return (left.shortValue() < right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final byte right) {", - " return (left.shortValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final short right) {", - " return (left.shortValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : int) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final int right) {", - " return (left.shortValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final long right) {", - " return (left.shortValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final float right) {", - " return (left.shortValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final double right) {", - " return (left.shortValue() <= right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Byte) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Byte right) {", - " return (left.shortValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Short) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Short right) {", - " return (left.shortValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Integer) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Integer right) {", - " return (left.shortValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Long) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Long right) {", - " return (left.shortValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Float) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Float right) {", - " return (left.shortValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Double) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Double right) {", - " return (left.shortValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Short, right : AtomicInteger) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicInteger right) {", - " return (left.shortValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Short, right : AtomicLong) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicLong right) {", - " return (left.shortValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_lowerEqualsThan_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short, right : AtomicDouble) : boolean {", - " left <= right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicDouble right) {", - " return (left.shortValue() <= right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final byte right) {", - " return (left != null && (left.shortValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final short right) {", - " return (left != null && (left.shortValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : int) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final int right) {", - " return (left != null && (left.shortValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final long right) {", - " return (left != null && (left.shortValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final float right) {", - " return (left != null && (left.shortValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final double right) {", - " return (left != null && (left.shortValue() == right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Byte) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Byte right) {", - " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Short) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Short right) {", - " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Integer) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Integer right) {", - " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Long) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Long right) {", - " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Float) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Float right) {", - " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Double) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Double right) {", - " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Short, right : AtomicInteger) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicInteger right) {", - " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Short, right : AtomicLong) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicLong right) {", - " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_equals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short, right : AtomicDouble) : boolean {", - " left == right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicDouble right) {", - " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - - @Test - public void operator_notEquals_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final byte right) {", - " return (left == null || (left.shortValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final short right) {", - " return (left == null || (left.shortValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : int) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final int right) {", - " return (left == null || (left.shortValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final long right) {", - " return (left == null || (left.shortValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final float right) {", - " return (left == null || (left.shortValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final double right) {", - " return (left == null || (left.shortValue() != right));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Byte) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Byte right) {", - " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Short) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Short right) {", - " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Integer) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Integer right) {", - " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Long) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Long right) {", - " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Float) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Float right) {", - " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Double) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final Double right) {", - " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Short, right : AtomicInteger) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicInteger right) {", - " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Short, right : AtomicLong) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicLong right) {", - " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_notEquals_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short, right : AtomicDouble) : boolean {", - " left != right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public boolean fct(final Short left, final AtomicDouble right) {", - " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final byte right) {", - " return Short.compare(left.shortValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final short right) {", - " return Short.compare(left.shortValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_int() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : int) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final int right) {", - " return Integer.compare(left.shortValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final long right) {", - " return Long.compare(left.shortValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final float right) {", - " return Float.compare(left.shortValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final double right) {", - " return Double.compare(left.shortValue(), right);", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Byte() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Byte) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Byte right) {", - " return Short.compare(left.shortValue(), right.byteValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Short() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Short) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Short right) {", - " return Short.compare(left.shortValue(), right.shortValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Integer() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Integer) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Integer right) {", - " return Integer.compare(left.shortValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Long() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Long) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Long right) {", - " return Long.compare(left.shortValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Float() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Float) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Float right) {", - " return Float.compare(left.shortValue(), right.floatValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Double() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "class A {", - " def fct(left : Short, right : Double) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final Double right) {", - " return Double.compare(left.shortValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicInteger() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicInteger", - "class A {", - " def fct(left : Short, right : AtomicInteger) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicInteger;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final AtomicInteger right) {", - " return Integer.compare(left.shortValue(), right.intValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_AtomicLong() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import java.util.concurrent.atomic.AtomicLong", - "class A {", - " def fct(left : Short, right : AtomicLong) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import java.util.concurrent.atomic.AtomicLong;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final AtomicLong right) {", - " return Long.compare(left.shortValue(), right.longValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - @Test - public void operator_spaceship_Byte_Number() throws Exception { - getCompileHelper().assertCompilesTo(multilineString( - "import com.google.common.util.concurrent.AtomicDouble", - "class A {", - " def fct(left : Short, right : AtomicDouble) : int {", - " left <=> right", - " }", - "}"), - multilineString( - "import com.google.common.util.concurrent.AtomicDouble;", - "import io.sarl.lang.annotation.SarlElementType;", - "import io.sarl.lang.annotation.SarlSpecification;", - "import io.sarl.lang.annotation.SyntheticMember;", - "import org.eclipse.xtext.xbase.lib.Pure;", - "", - "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", - "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", - "@SuppressWarnings(\"all\")", - "public class A {", - " @Pure", - " public int fct(final Short left, final AtomicDouble right) {", - " return Double.compare(left.shortValue(), right.doubleValue());", - " }", - " ", - " @SyntheticMember", - " public A() {", - " super();", - " }", - "}", - "")); - } - - } - -} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/byteobject/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/byteobject/CodeTest.java new file mode 100644 index 0000000000..587523ea56 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/byteobject/CodeTest.java @@ -0,0 +1,198 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.byteobject; + +import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_equals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_greaterEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_greaterThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_lessEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_lessThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_notEquals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.ByteComparisonExtensions.operator_spaceship; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Byte left = 4; + + private static Byte left2 = 2; + + private static int right = 3; + + private static int right2 = 5; + + @Test + public void operator_greaterEqualsThan_Byte_Number() { + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessEqualsThan_Byte_Number() { + assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_greaterThan_Byte_Number() { + assertTrue(operator_greaterThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessThan_Byte_Number() { + assertFalse(operator_lessThan(left, new AtomicDouble(right))); + assertTrue(operator_lessThan(left2, new AtomicDouble(right))); + assertFalse(operator_lessThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_equals_Byte_Number() { + assertFalse(operator_equals(left, new AtomicDouble(right))); + assertFalse(operator_equals(left2, new AtomicDouble(right))); + assertTrue(operator_equals(left, new AtomicDouble(left))); + } + + @Test + public void operator_notEquals_Byte_Number() { + assertTrue(operator_notEquals(left, new AtomicDouble(right))); + assertTrue(operator_notEquals(left2, new AtomicDouble(right))); + assertFalse(operator_notEquals(left, new AtomicDouble(left))); + } + + @Test + public void operator_spaceship_Byte_byte() { + assertStrictlyPositive(operator_spaceship(left, (byte) right)); + assertStrictlyNegative(operator_spaceship(left, (byte) right2)); + assertZero(operator_spaceship(left, (byte) left)); + } + + @Test + public void operator_spaceship_Byte_short() { + assertStrictlyPositive(operator_spaceship(left, (short) right)); + assertStrictlyNegative(operator_spaceship(left, (short) right2)); + assertZero(operator_spaceship(left, (short) left)); + } + + @Test + public void operator_spaceship_Byte_int() { + assertStrictlyPositive(operator_spaceship(left, (int) right)); + assertStrictlyNegative(operator_spaceship(left, (int) right2)); + assertZero(operator_spaceship(left, (int) left)); + } + + @Test + public void operator_spaceship_Byte_long() { + assertStrictlyPositive(operator_spaceship(left, (long) right)); + assertStrictlyNegative(operator_spaceship(left, (long) right2)); + assertZero(operator_spaceship(left, (long) left)); + } + + @Test + public void operator_spaceship_Byte_float() { + assertStrictlyPositive(operator_spaceship(left, (float) right)); + assertStrictlyNegative(operator_spaceship(left, (float) right2)); + assertZero(operator_spaceship(left, (float) left)); + } + + @Test + public void operator_spaceship_Byte_double() { + assertStrictlyPositive(operator_spaceship(left, (double) right)); + assertStrictlyNegative(operator_spaceship(left, (double) right2)); + assertZero(operator_spaceship(left, (double) left)); + } + + @Test + public void operator_spaceship_Byte_Byte() { + assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); + assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); + assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); + } + + @Test + public void operator_spaceship_Byte_Short() { + assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); + assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); + assertZero(operator_spaceship(left, Short.valueOf((short) left))); + } + + @Test + public void operator_spaceship_Byte_Integer() { + assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); + assertZero(operator_spaceship(left, Integer.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_Long() { + assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); + assertZero(operator_spaceship(left, Long.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_Float() { + assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); + assertZero(operator_spaceship(left, Float.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_Double() { + assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); + assertZero(operator_spaceship(left, Double.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_AtomicInteger() { + assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); + assertZero(operator_spaceship(left, new AtomicInteger(left))); + } + + @Test + public void operator_spaceship_Byte_AtomicLong() { + assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); + assertZero(operator_spaceship(left, new AtomicLong(left))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/byteobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/byteobject/CompilerTest.java new file mode 100644 index 0000000000..c13c3ea77c --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/byteobject/CompilerTest.java @@ -0,0 +1,3337 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.byteobject; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_greaterThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final byte right) {", + " return (left.byteValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final short right) {", + " return (left.byteValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : int) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final int right) {", + " return (left.byteValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final long right) {", + " return (left.byteValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final float right) {", + " return (left.byteValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final double right) {", + " return (left.byteValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Byte right) {", + " return (left.byteValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Short right) {", + " return (left.byteValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Integer) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Integer right) {", + " return (left.byteValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Long right) {", + " return (left.byteValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Float right) {", + " return (left.byteValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Double right) {", + " return (left.byteValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_greaterThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Byte, right : AtomicInteger) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicInteger right) {", + " return (left.byteValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Byte, right : AtomicLong) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicLong right) {", + " return (left.byteValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte, right : AtomicDouble) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicDouble right) {", + " return (left.byteValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final byte right) {", + " return (left.byteValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final short right) {", + " return (left.byteValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : int) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final int right) {", + " return (left.byteValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final long right) {", + " return (left.byteValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final float right) {", + " return (left.byteValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final double right) {", + " return (left.byteValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Byte right) {", + " return (left.byteValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Short right) {", + " return (left.byteValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Integer) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Integer right) {", + " return (left.byteValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Long right) {", + " return (left.byteValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Float right) {", + " return (left.byteValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Double right) {", + " return (left.byteValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Byte, right : AtomicInteger) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicInteger right) {", + " return (left.byteValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Byte, right : AtomicLong) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicLong right) {", + " return (left.byteValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte, right : AtomicDouble) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicDouble right) {", + " return (left.byteValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final byte right) {", + " return (left.byteValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final short right) {", + " return (left.byteValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : int) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final int right) {", + " return (left.byteValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final long right) {", + " return (left.byteValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final float right) {", + " return (left.byteValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final double right) {", + " return (left.byteValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Byte right) {", + " return (left.byteValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Short right) {", + " return (left.byteValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Integer) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Integer right) {", + " return (left.byteValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Long right) {", + " return (left.byteValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Float right) {", + " return (left.byteValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Double right) {", + " return (left.byteValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Byte, right : AtomicInteger) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicInteger right) {", + " return (left.byteValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Byte, right : AtomicLong) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicLong right) {", + " return (left.byteValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte, right : AtomicDouble) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicDouble right) {", + " return (left.byteValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final byte right) {", + " return (left.byteValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final short right) {", + " return (left.byteValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : int) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final int right) {", + " return (left.byteValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final long right) {", + " return (left.byteValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final float right) {", + " return (left.byteValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final double right) {", + " return (left.byteValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Byte right) {", + " return (left.byteValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Short right) {", + " return (left.byteValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Integer) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Integer right) {", + " return (left.byteValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Long right) {", + " return (left.byteValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Float right) {", + " return (left.byteValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Double right) {", + " return (left.byteValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Byte, right : AtomicInteger) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicInteger right) {", + " return (left.byteValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Byte, right : AtomicLong) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicLong right) {", + " return (left.byteValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte, right : AtomicDouble) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicDouble right) {", + " return (left.byteValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final byte right) {", + " return (left != null && (left.byteValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final short right) {", + " return (left != null && (left.byteValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : int) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final int right) {", + " return (left != null && (left.byteValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final long right) {", + " return (left != null && (left.byteValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final float right) {", + " return (left != null && (left.byteValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final double right) {", + " return (left != null && (left.byteValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Byte right) {", + " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Short right) {", + " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Integer) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Integer right) {", + " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Long right) {", + " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Float right) {", + " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Double right) {", + " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Byte, right : AtomicInteger) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicInteger right) {", + " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Byte, right : AtomicLong) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicLong right) {", + " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte, right : AtomicDouble) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicDouble right) {", + " return (left == null ? (right == null) : (right != null && left.byteValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_notEquals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final byte right) {", + " return (left == null || (left.byteValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final short right) {", + " return (left == null || (left.byteValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : int) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final int right) {", + " return (left == null || (left.byteValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final long right) {", + " return (left == null || (left.byteValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final float right) {", + " return (left == null || (left.byteValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final double right) {", + " return (left == null || (left.byteValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Byte right) {", + " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Short right) {", + " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Integer) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Integer right) {", + " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Long right) {", + " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Float right) {", + " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final Double right) {", + " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Byte, right : AtomicInteger) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicInteger right) {", + " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Byte, right : AtomicLong) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicLong right) {", + " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte, right : AtomicDouble) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Byte left, final AtomicDouble right) {", + " return (left == null ? (right != null) : (right == null || left.byteValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final byte right) {", + " return Byte.compare(left.byteValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final short right) {", + " return Short.compare(left.byteValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : int) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final int right) {", + " return Integer.compare(left.byteValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final long right) {", + " return Long.compare(left.byteValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final float right) {", + " return Float.compare(left.byteValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final double right) {", + " return Double.compare(left.byteValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Byte right) {", + " return Byte.compare(left.byteValue(), right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Short right) {", + " return Short.compare(left.byteValue(), right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Integer) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Integer right) {", + " return Integer.compare(left.byteValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Long right) {", + " return Long.compare(left.byteValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Float right) {", + " return Float.compare(left.byteValue(), right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Byte, right : Double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final Double right) {", + " return Double.compare(left.byteValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Byte, right : AtomicInteger) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final AtomicInteger right) {", + " return Integer.compare(left.byteValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Byte, right : AtomicLong) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final AtomicLong right) {", + " return Long.compare(left.byteValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Byte, right : AtomicDouble) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Byte left, final AtomicDouble right) {", + " return Double.compare(left.byteValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/byteprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/byteprimitive/CodeTest.java new file mode 100644 index 0000000000..84640d1530 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/byteprimitive/CodeTest.java @@ -0,0 +1,198 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.byteprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_equals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_greaterEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_greaterThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_lessEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_lessThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_notEquals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveByteComparisonExtensions.operator_spaceship; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static byte left = 4; + + private static byte left2 = 2; + + private static int right = 3; + + private static int right2 = 5; + + @Test + public void operator_greaterEqualsThan_byte_Number() { + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessEqualsThan_byte_Number() { + assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_greaterThan_byte_Number() { + assertTrue(operator_greaterThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessThan_byte_Number() { + assertFalse(operator_lessThan(left, new AtomicDouble(right))); + assertTrue(operator_lessThan(left2, new AtomicDouble(right))); + assertFalse(operator_lessThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_equals_byte_Number() { + assertFalse(operator_equals(left, new AtomicDouble(right))); + assertFalse(operator_equals(left2, new AtomicDouble(right))); + assertTrue(operator_equals(left, new AtomicDouble(left))); + } + + @Test + public void operator_notEquals_byte_Number() { + assertTrue(operator_notEquals(left, new AtomicDouble(right))); + assertTrue(operator_notEquals(left2, new AtomicDouble(right))); + assertFalse(operator_notEquals(left, new AtomicDouble(left))); + } + + @Test + public void operator_spaceship_byte_byte() { + assertStrictlyPositive(operator_spaceship(left, (byte) right)); + assertStrictlyNegative(operator_spaceship(left, (byte) right2)); + assertZero(operator_spaceship(left, (byte) left)); + } + + @Test + public void operator_spaceship_byte_short() { + assertStrictlyPositive(operator_spaceship(left, (short) right)); + assertStrictlyNegative(operator_spaceship(left, (short) right2)); + assertZero(operator_spaceship(left, (short) left)); + } + + @Test + public void operator_spaceship_byte_int() { + assertStrictlyPositive(operator_spaceship(left, (int) right)); + assertStrictlyNegative(operator_spaceship(left, (int) right2)); + assertZero(operator_spaceship(left, (int) left)); + } + + @Test + public void operator_spaceship_byte_long() { + assertStrictlyPositive(operator_spaceship(left, (long) right)); + assertStrictlyNegative(operator_spaceship(left, (long) right2)); + assertZero(operator_spaceship(left, (long) left)); + } + + @Test + public void operator_spaceship_byte_float() { + assertStrictlyPositive(operator_spaceship(left, (float) right)); + assertStrictlyNegative(operator_spaceship(left, (float) right2)); + assertZero(operator_spaceship(left, (float) left)); + } + + @Test + public void operator_spaceship_byte_double() { + assertStrictlyPositive(operator_spaceship(left, (double) right)); + assertStrictlyNegative(operator_spaceship(left, (double) right2)); + assertZero(operator_spaceship(left, (double) left)); + } + + @Test + public void operator_spaceship_byte_Byte() { + assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); + assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); + assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); + } + + @Test + public void operator_spaceship_byte_Short() { + assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); + assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); + assertZero(operator_spaceship(left, Short.valueOf((short) left))); + } + + @Test + public void operator_spaceship_byte_Integer() { + assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); + assertZero(operator_spaceship(left, Integer.valueOf(left))); + } + + @Test + public void operator_spaceship_byte_Long() { + assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); + assertZero(operator_spaceship(left, Long.valueOf(left))); + } + + @Test + public void operator_spaceship_byte_Float() { + assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); + assertZero(operator_spaceship(left, Float.valueOf(left))); + } + + @Test + public void operator_spaceship_byte_Double() { + assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); + assertZero(operator_spaceship(left, Double.valueOf(left))); + } + + @Test + public void operator_spaceship_byte_AtomicInteger() { + assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); + assertZero(operator_spaceship(left, new AtomicInteger(left))); + } + + @Test + public void operator_spaceship_byte_AtomicLong() { + assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); + assertZero(operator_spaceship(left, new AtomicLong(left))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/byteprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/byteprimitive/CompilerTest.java new file mode 100644 index 0000000000..274b392ea6 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/byteprimitive/CompilerTest.java @@ -0,0 +1,3337 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.byteprimitive; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_greaterThan_byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final byte right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final short right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : int) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final int right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final long right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final float right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final double right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Byte right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Short right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Integer) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Integer right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Long right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Float right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Double right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_greaterThan_byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : byte, right : AtomicInteger) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicInteger right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : byte, right : AtomicLong) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicLong right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte, right : AtomicDouble) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicDouble right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final byte right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final short right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : int) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final int right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final long right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final float right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final double right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Byte right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Short right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Integer) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Integer right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Long right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Float right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Double right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : byte, right : AtomicInteger) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicInteger right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : byte, right : AtomicLong) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicLong right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte, right : AtomicDouble) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicDouble right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final byte right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final short right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : int) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final int right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final long right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final float right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final double right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Byte right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Short right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Integer) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Integer right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Long right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Float right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Double right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : byte, right : AtomicInteger) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicInteger right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : byte, right : AtomicLong) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicLong right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte, right : AtomicDouble) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicDouble right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final byte right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final short right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : int) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final int right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final long right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final float right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final double right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Byte right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Short right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Integer) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Integer right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Long right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Float right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Double right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : byte, right : AtomicInteger) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicInteger right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : byte, right : AtomicLong) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicLong right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte, right : AtomicDouble) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicDouble right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final byte right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final short right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : int) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final int right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final long right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final float right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final double right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Byte right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Short right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Integer) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Integer right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Long right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Float right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Double right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : byte, right : AtomicInteger) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicInteger right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : byte, right : AtomicLong) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicLong right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte, right : AtomicDouble) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicDouble right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_notEquals_byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final byte right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final short right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : int) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final int right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final long right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final float right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final double right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Byte right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Short right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Integer) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Integer right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Long right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Float right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final Double right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : byte, right : AtomicInteger) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicInteger right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : byte, right : AtomicLong) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicLong right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte, right : AtomicDouble) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final byte left, final AtomicDouble right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final byte right) {", + " return Byte.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final short right) {", + " return Short.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : int) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final int right) {", + " return Integer.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final long right) {", + " return Long.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final float right) {", + " return Float.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final double right) {", + " return Double.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Byte right) {", + " return Byte.compare(left, right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Short right) {", + " return Short.compare(left, right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Integer) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Integer right) {", + " return Integer.compare(left, right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Long right) {", + " return Long.compare(left, right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Float right) {", + " return Float.compare(left, right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : byte, right : Double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final Double right) {", + " return Double.compare(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : byte, right : AtomicInteger) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final AtomicInteger right) {", + " return Integer.compare(left, right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : byte, right : AtomicLong) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final AtomicLong right) {", + " return Long.compare(left, right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : byte, right : AtomicDouble) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final byte left, final AtomicDouble right) {", + " return Double.compare(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/doubleobject/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/doubleobject/CodeTest.java new file mode 100644 index 0000000000..0e0c5f8d1f --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/doubleobject/CodeTest.java @@ -0,0 +1,198 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.doubleobject; + +import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_equals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_greaterEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_greaterThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_lessEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_lessThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_notEquals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.DoubleComparisonExtensions.operator_spaceship; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Double left = 4.; + + private static Double left2 = 2.; + + private static int right = 3; + + private static int right2 = 5; + + @Test + public void operator_greaterEqualsThan_Byte_Number() { + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessEqualsThan_Byte_Number() { + assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_greaterThan_Byte_Number() { + assertTrue(operator_greaterThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessThan_Byte_Number() { + assertFalse(operator_lessThan(left, new AtomicDouble(right))); + assertTrue(operator_lessThan(left2, new AtomicDouble(right))); + assertFalse(operator_lessThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_equals_Byte_Number() { + assertFalse(operator_equals(left, new AtomicDouble(right))); + assertFalse(operator_equals(left2, new AtomicDouble(right))); + assertTrue(operator_equals(left, new AtomicDouble(left))); + } + + @Test + public void operator_notEquals_Byte_Number() { + assertTrue(operator_notEquals(left, new AtomicDouble(right))); + assertTrue(operator_notEquals(left2, new AtomicDouble(right))); + assertFalse(operator_notEquals(left, new AtomicDouble(left))); + } + + @Test + public void operator_spaceship_Byte_byte() { + assertStrictlyPositive(operator_spaceship(left, (byte) right)); + assertStrictlyNegative(operator_spaceship(left, (byte) right2)); + assertZero(operator_spaceship(left, left.byteValue())); + } + + @Test + public void operator_spaceship_Byte_short() { + assertStrictlyPositive(operator_spaceship(left, (short) right)); + assertStrictlyNegative(operator_spaceship(left, (short) right2)); + assertZero(operator_spaceship(left, (short) left.doubleValue())); + } + + @Test + public void operator_spaceship_Byte_int() { + assertStrictlyPositive(operator_spaceship(left, (int) right)); + assertStrictlyNegative(operator_spaceship(left, (int) right2)); + assertZero(operator_spaceship(left, (int) left.doubleValue())); + } + + @Test + public void operator_spaceship_Byte_long() { + assertStrictlyPositive(operator_spaceship(left, (long) right)); + assertStrictlyNegative(operator_spaceship(left, (long) right2)); + assertZero(operator_spaceship(left, (long) left.longValue())); + } + + @Test + public void operator_spaceship_Byte_float() { + assertStrictlyPositive(operator_spaceship(left, (float) right)); + assertStrictlyNegative(operator_spaceship(left, (float) right2)); + assertZero(operator_spaceship(left, (float) left.floatValue())); + } + + @Test + public void operator_spaceship_Byte_double() { + assertStrictlyPositive(operator_spaceship(left, (double) right)); + assertStrictlyNegative(operator_spaceship(left, (double) right2)); + assertZero(operator_spaceship(left, (double) left)); + } + + @Test + public void operator_spaceship_Byte_Byte() { + assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); + assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); + assertZero(operator_spaceship(left, Byte.valueOf(left.byteValue()))); + } + + @Test + public void operator_spaceship_Byte_Short() { + assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); + assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); + assertZero(operator_spaceship(left, Short.valueOf((short) left.doubleValue()))); + } + + @Test + public void operator_spaceship_Byte_Integer() { + assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); + assertZero(operator_spaceship(left, Integer.valueOf(left.intValue()))); + } + + @Test + public void operator_spaceship_Byte_Long() { + assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); + assertZero(operator_spaceship(left, Long.valueOf(left.longValue()))); + } + + @Test + public void operator_spaceship_Byte_Float() { + assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); + assertZero(operator_spaceship(left, Float.valueOf(left.floatValue()))); + } + + @Test + public void operator_spaceship_Byte_Double() { + assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); + assertZero(operator_spaceship(left, Double.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_AtomicInteger() { + assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); + assertZero(operator_spaceship(left, new AtomicInteger(left.intValue()))); + } + + @Test + public void operator_spaceship_Byte_AtomicLong() { + assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); + assertZero(operator_spaceship(left, new AtomicLong(left.longValue()))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/doubleobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/doubleobject/CompilerTest.java new file mode 100644 index 0000000000..e0733da638 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/doubleobject/CompilerTest.java @@ -0,0 +1,3337 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.doubleobject; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_greaterThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final byte right) {", + " return (left.doubleValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final short right) {", + " return (left.doubleValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : int) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final int right) {", + " return (left.doubleValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final long right) {", + " return (left.doubleValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final float right) {", + " return (left.doubleValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final double right) {", + " return (left.doubleValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Byte right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Short right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Integer) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Integer right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Long right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Float right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Double right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_greaterThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Double, right : AtomicInteger) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicInteger right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Double, right : AtomicLong) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicLong right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double, right : AtomicDouble) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicDouble right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final byte right) {", + " return (left.doubleValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final short right) {", + " return (left.doubleValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : int) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final int right) {", + " return (left.doubleValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final long right) {", + " return (left.doubleValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final float right) {", + " return (left.doubleValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final double right) {", + " return (left.doubleValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Byte right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Short right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Integer) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Integer right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Long right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Float right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Double right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Double, right : AtomicInteger) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicInteger right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Double, right : AtomicLong) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicLong right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double, right : AtomicDouble) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicDouble right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final byte right) {", + " return (left.doubleValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final short right) {", + " return (left.doubleValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : int) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final int right) {", + " return (left.doubleValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final long right) {", + " return (left.doubleValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final float right) {", + " return (left.doubleValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final double right) {", + " return (left.doubleValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Byte right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Short right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Integer) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Integer right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Long right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Float right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Double right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Double, right : AtomicInteger) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicInteger right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Double, right : AtomicLong) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicLong right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double, right : AtomicDouble) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicDouble right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final byte right) {", + " return (left.doubleValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final short right) {", + " return (left.doubleValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : int) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final int right) {", + " return (left.doubleValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final long right) {", + " return (left.doubleValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final float right) {", + " return (left.doubleValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final double right) {", + " return (left.doubleValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Byte right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Short right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Integer) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Integer right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Long right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Float right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Double right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Double, right : AtomicInteger) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicInteger right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Double, right : AtomicLong) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicLong right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double, right : AtomicDouble) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicDouble right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final byte right) {", + " return (left != null && (left.doubleValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final short right) {", + " return (left != null && (left.doubleValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : int) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final int right) {", + " return (left != null && (left.doubleValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final long right) {", + " return (left != null && (left.doubleValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final float right) {", + " return (left != null && (left.doubleValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final double right) {", + " return (left != null && (left.doubleValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Byte right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Short right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Integer) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Integer right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Long right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Float right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Double right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Double, right : AtomicInteger) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicInteger right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Double, right : AtomicLong) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicLong right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double, right : AtomicDouble) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicDouble right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_notEquals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final byte right) {", + " return (left == null || (left.doubleValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final short right) {", + " return (left == null || (left.doubleValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : int) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final int right) {", + " return (left == null || (left.doubleValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final long right) {", + " return (left == null || (left.doubleValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final float right) {", + " return (left == null || (left.doubleValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final double right) {", + " return (left == null || (left.doubleValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Byte right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Short right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Integer) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Integer right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Long right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Float right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final Double right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Double, right : AtomicInteger) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicInteger right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Double, right : AtomicLong) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicLong right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double, right : AtomicDouble) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Double left, final AtomicDouble right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final byte right) {", + " return Double.compare(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final short right) {", + " return Double.compare(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : int) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final int right) {", + " return Double.compare(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final long right) {", + " return Double.compare(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final float right) {", + " return Double.compare(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final double right) {", + " return Double.compare(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final Byte right) {", + " return Double.compare(left.doubleValue(), right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final Short right) {", + " return Double.compare(left.doubleValue(), right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Integer) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final Integer right) {", + " return Double.compare(left.doubleValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final Long right) {", + " return Double.compare(left.doubleValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final Float right) {", + " return Double.compare(left.doubleValue(), right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Double, right : Double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final Double right) {", + " return Double.compare(left.doubleValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Double, right : AtomicInteger) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final AtomicInteger right) {", + " return Double.compare(left.doubleValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Double, right : AtomicLong) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final AtomicLong right) {", + " return Double.compare(left.doubleValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Double, right : AtomicDouble) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Double left, final AtomicDouble right) {", + " return Double.compare(left.doubleValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/doubleprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/doubleprimitive/CodeTest.java new file mode 100644 index 0000000000..c1ec9cf875 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/doubleprimitive/CodeTest.java @@ -0,0 +1,198 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.doubleprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_equals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_greaterEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_greaterThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_lessEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_lessThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_notEquals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveDoubleComparisonExtensions.operator_spaceship; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static double left = 4; + + private static double left2 = 2; + + private static int right = 3; + + private static int right2 = 5; + + @Test + public void operator_greaterEqualsThan_double_Number() { + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessEqualsThan_double_Number() { + assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_greaterThan_double_Number() { + assertTrue(operator_greaterThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessThan_double_Number() { + assertFalse(operator_lessThan(left, new AtomicDouble(right))); + assertTrue(operator_lessThan(left2, new AtomicDouble(right))); + assertFalse(operator_lessThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_equals_double_Number() { + assertFalse(operator_equals(left, new AtomicDouble(right))); + assertFalse(operator_equals(left2, new AtomicDouble(right))); + assertTrue(operator_equals(left, new AtomicDouble(left))); + } + + @Test + public void operator_notEquals_double_Number() { + assertTrue(operator_notEquals(left, new AtomicDouble(right))); + assertTrue(operator_notEquals(left2, new AtomicDouble(right))); + assertFalse(operator_notEquals(left, new AtomicDouble(left))); + } + + @Test + public void operator_spaceship_double_byte() { + assertStrictlyPositive(operator_spaceship(left, (byte) right)); + assertStrictlyNegative(operator_spaceship(left, (byte) right2)); + assertZero(operator_spaceship(left, (byte) left)); + } + + @Test + public void operator_spaceship_double_short() { + assertStrictlyPositive(operator_spaceship(left, (short) right)); + assertStrictlyNegative(operator_spaceship(left, (short) right2)); + assertZero(operator_spaceship(left, (short) left)); + } + + @Test + public void operator_spaceship_double_int() { + assertStrictlyPositive(operator_spaceship(left, (int) right)); + assertStrictlyNegative(operator_spaceship(left, (int) right2)); + assertZero(operator_spaceship(left, (int) left)); + } + + @Test + public void operator_spaceship_double_long() { + assertStrictlyPositive(operator_spaceship(left, (long) right)); + assertStrictlyNegative(operator_spaceship(left, (long) right2)); + assertZero(operator_spaceship(left, (long) left)); + } + + @Test + public void operator_spaceship_double_float() { + assertStrictlyPositive(operator_spaceship(left, (float) right)); + assertStrictlyNegative(operator_spaceship(left, (float) right2)); + assertZero(operator_spaceship(left, (float) left)); + } + + @Test + public void operator_spaceship_double_double() { + assertStrictlyPositive(operator_spaceship(left, (double) right)); + assertStrictlyNegative(operator_spaceship(left, (double) right2)); + assertZero(operator_spaceship(left, (double) left)); + } + + @Test + public void operator_spaceship_double_Byte() { + assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); + assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); + assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); + } + + @Test + public void operator_spaceship_double_Short() { + assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); + assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); + assertZero(operator_spaceship(left, Short.valueOf((short) left))); + } + + @Test + public void operator_spaceship_double_Integer() { + assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); + assertZero(operator_spaceship(left, Integer.valueOf((int) left))); + } + + @Test + public void operator_spaceship_double_Long() { + assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); + assertZero(operator_spaceship(left, Long.valueOf((long) left))); + } + + @Test + public void operator_spaceship_double_Float() { + assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); + assertZero(operator_spaceship(left, Float.valueOf((float) left))); + } + + @Test + public void operator_spaceship_double_Double() { + assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); + assertZero(operator_spaceship(left, Double.valueOf(left))); + } + + @Test + public void operator_spaceship_double_AtomicInteger() { + assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); + assertZero(operator_spaceship(left, new AtomicInteger((int) left))); + } + + @Test + public void operator_spaceship_double_AtomicLong() { + assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); + assertZero(operator_spaceship(left, new AtomicLong((long) left))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/doubleprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/doubleprimitive/CompilerTest.java new file mode 100644 index 0000000000..3435ffc172 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/doubleprimitive/CompilerTest.java @@ -0,0 +1,3337 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.doubleprimitive; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_greaterThan_double_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final byte right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_double_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final short right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_double_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : int) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final int right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_double_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final long right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_double_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final float right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_double_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final double right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Byte right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Short right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Integer) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Integer right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Long right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Float right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_double_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Double right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_greaterThan_double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : double, right : AtomicInteger) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicInteger right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : double, right : AtomicLong) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicLong right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double, right : AtomicDouble) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicDouble right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final byte right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final short right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : int) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final int right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final long right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final float right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final double right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Byte right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Short right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Integer) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Integer right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Long right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Float right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Double right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : double, right : AtomicInteger) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicInteger right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : double, right : AtomicLong) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicLong right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double, right : AtomicDouble) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicDouble right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final byte right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final short right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : int) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final int right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final long right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final float right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final double right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Byte right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Short right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Integer) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Integer right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Long right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Float right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Double right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : double, right : AtomicInteger) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicInteger right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : double, right : AtomicLong) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicLong right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double, right : AtomicDouble) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicDouble right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final byte right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final short right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : int) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final int right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final long right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final float right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final double right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Byte right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Short right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Integer) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Integer right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Long right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Float right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Double right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : double, right : AtomicInteger) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicInteger right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : double, right : AtomicLong) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicLong right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double, right : AtomicDouble) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicDouble right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final byte right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final short right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : int) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final int right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final long right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final float right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final double right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Byte right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Short right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Integer) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Integer right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Long right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Float right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Double right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : double, right : AtomicInteger) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicInteger right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : double, right : AtomicLong) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicLong right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double, right : AtomicDouble) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicDouble right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_notEquals_double_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final byte right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final short right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : int) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final int right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final long right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final float right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final double right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Byte right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Short right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Integer) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Integer right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Long right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Float right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final Double right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : double, right : AtomicInteger) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicInteger right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : double, right : AtomicLong) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicLong right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double, right : AtomicDouble) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final double left, final AtomicDouble right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final byte right) {", + " return Double.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final short right) {", + " return Double.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : int) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final int right) {", + " return Double.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final long right) {", + " return Double.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final float right) {", + " return Double.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final double right) {", + " return Double.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final Byte right) {", + " return Double.compare(left, right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final Short right) {", + " return Double.compare(left, right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Integer) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final Integer right) {", + " return Double.compare(left, right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final Long right) {", + " return Double.compare(left, right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final Float right) {", + " return Double.compare(left, right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : double, right : Double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final Double right) {", + " return Double.compare(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : double, right : AtomicInteger) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final AtomicInteger right) {", + " return Double.compare(left, right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : double, right : AtomicLong) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final AtomicLong right) {", + " return Double.compare(left, right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_double_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : double, right : AtomicDouble) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final double left, final AtomicDouble right) {", + " return Double.compare(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/floatobject/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/floatobject/CodeTest.java new file mode 100644 index 0000000000..414ca39035 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/floatobject/CodeTest.java @@ -0,0 +1,198 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.floatobject; + +import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_equals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_greaterEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_greaterThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_lessEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_lessThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_notEquals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.FloatComparisonExtensions.operator_spaceship; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Float left = 4f; + + private static Float left2 = 2f; + + private static int right = 3; + + private static int right2 = 5; + + @Test + public void operator_greaterEqualsThan_Byte_Number() { + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessEqualsThan_Byte_Number() { + assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_greaterThan_Byte_Number() { + assertTrue(operator_greaterThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessThan_Byte_Number() { + assertFalse(operator_lessThan(left, new AtomicDouble(right))); + assertTrue(operator_lessThan(left2, new AtomicDouble(right))); + assertFalse(operator_lessThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_equals_Byte_Number() { + assertFalse(operator_equals(left, new AtomicDouble(right))); + assertFalse(operator_equals(left2, new AtomicDouble(right))); + assertTrue(operator_equals(left, new AtomicDouble(left))); + } + + @Test + public void operator_notEquals_Byte_Number() { + assertTrue(operator_notEquals(left, new AtomicDouble(right))); + assertTrue(operator_notEquals(left2, new AtomicDouble(right))); + assertFalse(operator_notEquals(left, new AtomicDouble(left))); + } + + @Test + public void operator_spaceship_Byte_byte() { + assertStrictlyPositive(operator_spaceship(left, (byte) right)); + assertStrictlyNegative(operator_spaceship(left, (byte) right2)); + assertZero(operator_spaceship(left, left.byteValue())); + } + + @Test + public void operator_spaceship_Byte_short() { + assertStrictlyPositive(operator_spaceship(left, (short) right)); + assertStrictlyNegative(operator_spaceship(left, (short) right2)); + assertZero(operator_spaceship(left, (short) left.floatValue())); + } + + @Test + public void operator_spaceship_Byte_int() { + assertStrictlyPositive(operator_spaceship(left, (int) right)); + assertStrictlyNegative(operator_spaceship(left, (int) right2)); + assertZero(operator_spaceship(left, (int) left.floatValue())); + } + + @Test + public void operator_spaceship_Byte_long() { + assertStrictlyPositive(operator_spaceship(left, (long) right)); + assertStrictlyNegative(operator_spaceship(left, (long) right2)); + assertZero(operator_spaceship(left, (long) left.longValue())); + } + + @Test + public void operator_spaceship_Byte_float() { + assertStrictlyPositive(operator_spaceship(left, (float) right)); + assertStrictlyNegative(operator_spaceship(left, (float) right2)); + assertZero(operator_spaceship(left, (float) left)); + } + + @Test + public void operator_spaceship_Byte_double() { + assertStrictlyPositive(operator_spaceship(left, (double) right)); + assertStrictlyNegative(operator_spaceship(left, (double) right2)); + assertZero(operator_spaceship(left, (double) left)); + } + + @Test + public void operator_spaceship_Byte_Byte() { + assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); + assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); + assertZero(operator_spaceship(left, Byte.valueOf(left.byteValue()))); + } + + @Test + public void operator_spaceship_Byte_Short() { + assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); + assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); + assertZero(operator_spaceship(left, Short.valueOf((short) left.floatValue()))); + } + + @Test + public void operator_spaceship_Byte_Integer() { + assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); + assertZero(operator_spaceship(left, Integer.valueOf(left.intValue()))); + } + + @Test + public void operator_spaceship_Byte_Long() { + assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); + assertZero(operator_spaceship(left, Long.valueOf(left.longValue()))); + } + + @Test + public void operator_spaceship_Byte_Float() { + assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); + assertZero(operator_spaceship(left, Float.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_Double() { + assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); + assertZero(operator_spaceship(left, Double.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_AtomicInteger() { + assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); + assertZero(operator_spaceship(left, new AtomicInteger(left.intValue()))); + } + + @Test + public void operator_spaceship_Byte_AtomicLong() { + assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); + assertZero(operator_spaceship(left, new AtomicLong(left.longValue()))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/floatobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/floatobject/CompilerTest.java new file mode 100644 index 0000000000..a3f6717f1d --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/floatobject/CompilerTest.java @@ -0,0 +1,3337 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.floatobject; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_greaterThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final byte right) {", + " return (left.floatValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final short right) {", + " return (left.floatValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : int) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final int right) {", + " return (left.floatValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final long right) {", + " return (left.floatValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final float right) {", + " return (left.floatValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final double right) {", + " return (left.floatValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Byte right) {", + " return (left.floatValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Short right) {", + " return (left.floatValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Integer) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Integer right) {", + " return (left.floatValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Long right) {", + " return (left.floatValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Float right) {", + " return (left.floatValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Double right) {", + " return (left.floatValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_greaterThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Float, right : AtomicInteger) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicInteger right) {", + " return (left.floatValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Float, right : AtomicLong) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicLong right) {", + " return (left.floatValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float, right : AtomicDouble) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicDouble right) {", + " return (left.floatValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final byte right) {", + " return (left.floatValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final short right) {", + " return (left.floatValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : int) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final int right) {", + " return (left.floatValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final long right) {", + " return (left.floatValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final float right) {", + " return (left.floatValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final double right) {", + " return (left.floatValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Byte right) {", + " return (left.floatValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Short right) {", + " return (left.floatValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Integer) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Integer right) {", + " return (left.floatValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Long right) {", + " return (left.floatValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Float right) {", + " return (left.floatValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Double right) {", + " return (left.floatValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Float, right : AtomicInteger) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicInteger right) {", + " return (left.floatValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Float, right : AtomicLong) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicLong right) {", + " return (left.floatValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float, right : AtomicDouble) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicDouble right) {", + " return (left.floatValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final byte right) {", + " return (left.floatValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final short right) {", + " return (left.floatValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : int) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final int right) {", + " return (left.floatValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final long right) {", + " return (left.floatValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final float right) {", + " return (left.floatValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final double right) {", + " return (left.floatValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Byte right) {", + " return (left.floatValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Short right) {", + " return (left.floatValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Integer) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Integer right) {", + " return (left.floatValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Long right) {", + " return (left.floatValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Float right) {", + " return (left.floatValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Double right) {", + " return (left.floatValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Float, right : AtomicInteger) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicInteger right) {", + " return (left.floatValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Float, right : AtomicLong) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicLong right) {", + " return (left.floatValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float, right : AtomicDouble) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicDouble right) {", + " return (left.floatValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final byte right) {", + " return (left.floatValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final short right) {", + " return (left.floatValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : int) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final int right) {", + " return (left.floatValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final long right) {", + " return (left.floatValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final float right) {", + " return (left.floatValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final double right) {", + " return (left.floatValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Byte right) {", + " return (left.floatValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Short right) {", + " return (left.floatValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Integer) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Integer right) {", + " return (left.floatValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Long right) {", + " return (left.floatValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Float right) {", + " return (left.floatValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Double right) {", + " return (left.floatValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Float, right : AtomicInteger) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicInteger right) {", + " return (left.floatValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Float, right : AtomicLong) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicLong right) {", + " return (left.floatValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float, right : AtomicDouble) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicDouble right) {", + " return (left.floatValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final byte right) {", + " return (left != null && (left.floatValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final short right) {", + " return (left != null && (left.floatValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : int) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final int right) {", + " return (left != null && (left.floatValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final long right) {", + " return (left != null && (left.floatValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final float right) {", + " return (left != null && (left.floatValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final double right) {", + " return (left != null && (left.floatValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Byte right) {", + " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Short right) {", + " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Integer) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Integer right) {", + " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Long right) {", + " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Float right) {", + " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Double right) {", + " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Float, right : AtomicInteger) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicInteger right) {", + " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Float, right : AtomicLong) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicLong right) {", + " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float, right : AtomicDouble) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicDouble right) {", + " return (left == null ? (right == null) : (right != null && left.floatValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_notEquals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final byte right) {", + " return (left == null || (left.floatValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final short right) {", + " return (left == null || (left.floatValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : int) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final int right) {", + " return (left == null || (left.floatValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final long right) {", + " return (left == null || (left.floatValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final float right) {", + " return (left == null || (left.floatValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final double right) {", + " return (left == null || (left.floatValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Byte right) {", + " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Short right) {", + " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Integer) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Integer right) {", + " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Long right) {", + " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Float right) {", + " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final Double right) {", + " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Float, right : AtomicInteger) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicInteger right) {", + " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Float, right : AtomicLong) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicLong right) {", + " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float, right : AtomicDouble) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Float left, final AtomicDouble right) {", + " return (left == null ? (right != null) : (right == null || left.floatValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final byte right) {", + " return Float.compare(left.floatValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final short right) {", + " return Float.compare(left.floatValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : int) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final int right) {", + " return Float.compare(left.floatValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final long right) {", + " return Float.compare(left.floatValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final float right) {", + " return Float.compare(left.floatValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final double right) {", + " return Double.compare(left.floatValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final Byte right) {", + " return Float.compare(left.floatValue(), right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final Short right) {", + " return Float.compare(left.floatValue(), right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Integer) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final Integer right) {", + " return Float.compare(left.floatValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final Long right) {", + " return Float.compare(left.floatValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final Float right) {", + " return Float.compare(left.floatValue(), right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Float, right : Double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final Double right) {", + " return Double.compare(left.floatValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Float, right : AtomicInteger) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final AtomicInteger right) {", + " return Float.compare(left.floatValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Float, right : AtomicLong) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final AtomicLong right) {", + " return Float.compare(left.floatValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Float, right : AtomicDouble) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Float left, final AtomicDouble right) {", + " return Double.compare(left.floatValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/floatprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/floatprimitive/CodeTest.java new file mode 100644 index 0000000000..5bdb6f88df --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/floatprimitive/CodeTest.java @@ -0,0 +1,198 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.floatprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_equals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_greaterEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_greaterThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_lessEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_lessThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_notEquals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveFloatComparisonExtensions.operator_spaceship; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static float left = 4; + + private static float left2 = 2; + + private static int right = 3; + + private static int right2 = 5; + + @Test + public void operator_greaterEqualsThan_short_Number() { + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessEqualsThan_short_Number() { + assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_greaterThan_short_Number() { + assertTrue(operator_greaterThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessThan_short_Number() { + assertFalse(operator_lessThan(left, new AtomicDouble(right))); + assertTrue(operator_lessThan(left2, new AtomicDouble(right))); + assertFalse(operator_lessThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_equals_short_Number() { + assertFalse(operator_equals(left, new AtomicDouble(right))); + assertFalse(operator_equals(left2, new AtomicDouble(right))); + assertTrue(operator_equals(left, new AtomicDouble(left))); + } + + @Test + public void operator_notEquals_short_Number() { + assertTrue(operator_notEquals(left, new AtomicDouble(right))); + assertTrue(operator_notEquals(left2, new AtomicDouble(right))); + assertFalse(operator_notEquals(left, new AtomicDouble(left))); + } + + @Test + public void operator_spaceship_short_byte() { + assertStrictlyPositive(operator_spaceship(left, (byte) right)); + assertStrictlyNegative(operator_spaceship(left, (byte) right2)); + assertZero(operator_spaceship(left, (byte) left)); + } + + @Test + public void operator_spaceship_short_short() { + assertStrictlyPositive(operator_spaceship(left, (short) right)); + assertStrictlyNegative(operator_spaceship(left, (short) right2)); + assertZero(operator_spaceship(left, (short) left)); + } + + @Test + public void operator_spaceship_short_int() { + assertStrictlyPositive(operator_spaceship(left, (int) right)); + assertStrictlyNegative(operator_spaceship(left, (int) right2)); + assertZero(operator_spaceship(left, (int) left)); + } + + @Test + public void operator_spaceship_short_long() { + assertStrictlyPositive(operator_spaceship(left, (long) right)); + assertStrictlyNegative(operator_spaceship(left, (long) right2)); + assertZero(operator_spaceship(left, (long) left)); + } + + @Test + public void operator_spaceship_short_float() { + assertStrictlyPositive(operator_spaceship(left, (float) right)); + assertStrictlyNegative(operator_spaceship(left, (float) right2)); + assertZero(operator_spaceship(left, (float) left)); + } + + @Test + public void operator_spaceship_short_double() { + assertStrictlyPositive(operator_spaceship(left, (double) right)); + assertStrictlyNegative(operator_spaceship(left, (double) right2)); + assertZero(operator_spaceship(left, (double) left)); + } + + @Test + public void operator_spaceship_short_Byte() { + assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); + assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); + assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); + } + + @Test + public void operator_spaceship_short_Short() { + assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); + assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); + assertZero(operator_spaceship(left, Short.valueOf((short) left))); + } + + @Test + public void operator_spaceship_short_Integer() { + assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); + assertZero(operator_spaceship(left, Integer.valueOf((int) left))); + } + + @Test + public void operator_spaceship_short_Long() { + assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); + assertZero(operator_spaceship(left, Long.valueOf((long) left))); + } + + @Test + public void operator_spaceship_short_Float() { + assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); + assertZero(operator_spaceship(left, Float.valueOf(left))); + } + + @Test + public void operator_spaceship_short_Double() { + assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); + assertZero(operator_spaceship(left, Double.valueOf(left))); + } + + @Test + public void operator_spaceship_short_AtomicInteger() { + assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); + assertZero(operator_spaceship(left, new AtomicInteger((int) left))); + } + + @Test + public void operator_spaceship_short_AtomicLong() { + assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); + assertZero(operator_spaceship(left, new AtomicLong((long) left))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/floatprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/floatprimitive/CompilerTest.java new file mode 100644 index 0000000000..abef7798a3 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/floatprimitive/CompilerTest.java @@ -0,0 +1,3337 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.floatprimitive; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_greaterThan_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final byte right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final short right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : int) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final int right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final long right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final float right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final double right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Byte right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Short right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Integer) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Integer right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Long right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Float right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Double right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_greaterThan_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : float, right : AtomicInteger) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicInteger right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : float, right : AtomicLong) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicLong right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float, right : AtomicDouble) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicDouble right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final byte right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final short right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : int) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final int right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final long right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final float right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final double right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Byte right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Short right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Integer) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Integer right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Long right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Float right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Double right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : float, right : AtomicInteger) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicInteger right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : float, right : AtomicLong) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicLong right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float, right : AtomicDouble) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicDouble right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final byte right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final short right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : int) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final int right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final long right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final float right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final double right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Byte right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Short right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Integer) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Integer right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Long right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Float right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Double right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : float, right : AtomicInteger) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicInteger right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : float, right : AtomicLong) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicLong right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float, right : AtomicDouble) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicDouble right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final byte right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final short right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : int) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final int right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final long right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final float right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final double right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Byte right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Short right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Integer) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Integer right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Long right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Float right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Double right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : float, right : AtomicInteger) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicInteger right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : float, right : AtomicLong) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicLong right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float, right : AtomicDouble) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicDouble right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final byte right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final short right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : int) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final int right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final long right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final float right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final double right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Byte right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Short right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Integer) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Integer right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Long right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Float right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Double right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : float, right : AtomicInteger) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicInteger right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : float, right : AtomicLong) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicLong right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float, right : AtomicDouble) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicDouble right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_notEquals_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final byte right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final short right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : int) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final int right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final long right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final float right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final double right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Byte right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Short right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Integer) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Integer right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Long right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Float right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final Double right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : float, right : AtomicInteger) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicInteger right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : float, right : AtomicLong) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicLong right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float, right : AtomicDouble) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final float left, final AtomicDouble right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final byte right) {", + " return Float.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final short right) {", + " return Float.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : int) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final int right) {", + " return Float.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final long right) {", + " return Float.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final float right) {", + " return Float.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final double right) {", + " return Double.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final Byte right) {", + " return Float.compare(left, right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final Short right) {", + " return Float.compare(left, right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Integer) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final Integer right) {", + " return Float.compare(left, right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final Long right) {", + " return Float.compare(left, right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final Float right) {", + " return Float.compare(left, right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : float, right : Double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final Double right) {", + " return Double.compare(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : float, right : AtomicInteger) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final AtomicInteger right) {", + " return Float.compare(left, right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : float, right : AtomicLong) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final AtomicLong right) {", + " return Float.compare(left, right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : float, right : AtomicDouble) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final float left, final AtomicDouble right) {", + " return Double.compare(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/integerobject/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/integerobject/CodeTest.java new file mode 100644 index 0000000000..9e7808c1f5 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/integerobject/CodeTest.java @@ -0,0 +1,198 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.integerobject; + +import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_equals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_greaterEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_greaterThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_lessEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_lessThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_notEquals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.IntegerComparisonExtensions.operator_spaceship; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Integer left = 4; + + private static Integer left2 = 2; + + private static int right = 3; + + private static int right2 = 5; + + @Test + public void operator_greaterEqualsThan_Byte_Number() { + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessEqualsThan_Byte_Number() { + assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_greaterThan_Byte_Number() { + assertTrue(operator_greaterThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessThan_Byte_Number() { + assertFalse(operator_lessThan(left, new AtomicDouble(right))); + assertTrue(operator_lessThan(left2, new AtomicDouble(right))); + assertFalse(operator_lessThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_equals_Byte_Number() { + assertFalse(operator_equals(left, new AtomicDouble(right))); + assertFalse(operator_equals(left2, new AtomicDouble(right))); + assertTrue(operator_equals(left, new AtomicDouble(left))); + } + + @Test + public void operator_notEquals_Byte_Number() { + assertTrue(operator_notEquals(left, new AtomicDouble(right))); + assertTrue(operator_notEquals(left2, new AtomicDouble(right))); + assertFalse(operator_notEquals(left, new AtomicDouble(left))); + } + + @Test + public void operator_spaceship_Byte_byte() { + assertStrictlyPositive(operator_spaceship(left, (byte) right)); + assertStrictlyNegative(operator_spaceship(left, (byte) right2)); + assertZero(operator_spaceship(left, left.byteValue())); + } + + @Test + public void operator_spaceship_Byte_short() { + assertStrictlyPositive(operator_spaceship(left, (short) right)); + assertStrictlyNegative(operator_spaceship(left, (short) right2)); + assertZero(operator_spaceship(left, (short) left.intValue())); + } + + @Test + public void operator_spaceship_Byte_int() { + assertStrictlyPositive(operator_spaceship(left, (int) right)); + assertStrictlyNegative(operator_spaceship(left, (int) right2)); + assertZero(operator_spaceship(left, (int) left)); + } + + @Test + public void operator_spaceship_Byte_long() { + assertStrictlyPositive(operator_spaceship(left, (long) right)); + assertStrictlyNegative(operator_spaceship(left, (long) right2)); + assertZero(operator_spaceship(left, (long) left)); + } + + @Test + public void operator_spaceship_Byte_float() { + assertStrictlyPositive(operator_spaceship(left, (float) right)); + assertStrictlyNegative(operator_spaceship(left, (float) right2)); + assertZero(operator_spaceship(left, (float) left)); + } + + @Test + public void operator_spaceship_Byte_double() { + assertStrictlyPositive(operator_spaceship(left, (double) right)); + assertStrictlyNegative(operator_spaceship(left, (double) right2)); + assertZero(operator_spaceship(left, (double) left)); + } + + @Test + public void operator_spaceship_Byte_Byte() { + assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); + assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); + assertZero(operator_spaceship(left, Byte.valueOf(left.byteValue()))); + } + + @Test + public void operator_spaceship_Byte_Short() { + assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); + assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); + assertZero(operator_spaceship(left, Short.valueOf((short) left.intValue()))); + } + + @Test + public void operator_spaceship_Byte_Integer() { + assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); + assertZero(operator_spaceship(left, Integer.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_Long() { + assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); + assertZero(operator_spaceship(left, Long.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_Float() { + assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); + assertZero(operator_spaceship(left, Float.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_Double() { + assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); + assertZero(operator_spaceship(left, Double.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_AtomicInteger() { + assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); + assertZero(operator_spaceship(left, new AtomicInteger(left))); + } + + @Test + public void operator_spaceship_Byte_AtomicLong() { + assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); + assertZero(operator_spaceship(left, new AtomicLong(left))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/integerobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/integerobject/CompilerTest.java new file mode 100644 index 0000000000..671eccac6a --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/integerobject/CompilerTest.java @@ -0,0 +1,3337 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.integerobject; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_greaterThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final byte right) {", + " return (left.intValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final short right) {", + " return (left.intValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : int) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final int right) {", + " return (left.intValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final long right) {", + " return (left.intValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final float right) {", + " return (left.intValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final double right) {", + " return (left.intValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Byte right) {", + " return (left.intValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Short right) {", + " return (left.intValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Integer) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Integer right) {", + " return (left.intValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Long right) {", + " return (left.intValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Float right) {", + " return (left.intValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Double right) {", + " return (left.intValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_greaterThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Integer, right : AtomicInteger) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicInteger right) {", + " return (left.intValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Integer, right : AtomicLong) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicLong right) {", + " return (left.intValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer, right : AtomicDouble) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicDouble right) {", + " return (left.intValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final byte right) {", + " return (left.intValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final short right) {", + " return (left.intValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : int) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final int right) {", + " return (left.intValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final long right) {", + " return (left.intValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final float right) {", + " return (left.intValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final double right) {", + " return (left.intValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Byte right) {", + " return (left.intValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Short right) {", + " return (left.intValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Integer) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Integer right) {", + " return (left.intValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Long right) {", + " return (left.intValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Float right) {", + " return (left.intValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Double right) {", + " return (left.intValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Integer, right : AtomicInteger) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicInteger right) {", + " return (left.intValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Integer, right : AtomicLong) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicLong right) {", + " return (left.intValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer, right : AtomicDouble) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicDouble right) {", + " return (left.intValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final byte right) {", + " return (left.intValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final short right) {", + " return (left.intValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : int) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final int right) {", + " return (left.intValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final long right) {", + " return (left.intValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final float right) {", + " return (left.intValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final double right) {", + " return (left.intValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Byte right) {", + " return (left.intValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Short right) {", + " return (left.intValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Integer) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Integer right) {", + " return (left.intValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Long right) {", + " return (left.intValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Float right) {", + " return (left.intValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Double right) {", + " return (left.intValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Integer, right : AtomicInteger) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicInteger right) {", + " return (left.intValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Integer, right : AtomicLong) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicLong right) {", + " return (left.intValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer, right : AtomicDouble) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicDouble right) {", + " return (left.intValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final byte right) {", + " return (left.intValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final short right) {", + " return (left.intValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : int) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final int right) {", + " return (left.intValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final long right) {", + " return (left.intValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final float right) {", + " return (left.intValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final double right) {", + " return (left.intValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Byte right) {", + " return (left.intValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Short right) {", + " return (left.intValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Integer) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Integer right) {", + " return (left.intValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Long right) {", + " return (left.intValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Float right) {", + " return (left.intValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Double right) {", + " return (left.intValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Integer, right : AtomicInteger) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicInteger right) {", + " return (left.intValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Integer, right : AtomicLong) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicLong right) {", + " return (left.intValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer, right : AtomicDouble) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicDouble right) {", + " return (left.intValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final byte right) {", + " return (left != null && (left.intValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final short right) {", + " return (left != null && (left.intValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : int) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final int right) {", + " return (left != null && (left.intValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final long right) {", + " return (left != null && (left.intValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final float right) {", + " return (left != null && (left.intValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final double right) {", + " return (left != null && (left.intValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Byte right) {", + " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Short right) {", + " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Integer) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Integer right) {", + " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Long right) {", + " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Float right) {", + " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Double right) {", + " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Integer, right : AtomicInteger) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicInteger right) {", + " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Integer, right : AtomicLong) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicLong right) {", + " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer, right : AtomicDouble) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicDouble right) {", + " return (left == null ? (right == null) : (right != null && left.intValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_notEquals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final byte right) {", + " return (left == null || (left.intValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final short right) {", + " return (left == null || (left.intValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : int) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final int right) {", + " return (left == null || (left.intValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final long right) {", + " return (left == null || (left.intValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final float right) {", + " return (left == null || (left.intValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final double right) {", + " return (left == null || (left.intValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Byte right) {", + " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Short right) {", + " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Integer) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Integer right) {", + " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Long right) {", + " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Float right) {", + " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final Double right) {", + " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Integer, right : AtomicInteger) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicInteger right) {", + " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Integer, right : AtomicLong) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicLong right) {", + " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer, right : AtomicDouble) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Integer left, final AtomicDouble right) {", + " return (left == null ? (right != null) : (right == null || left.intValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final byte right) {", + " return Integer.compare(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final short right) {", + " return Integer.compare(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : int) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final int right) {", + " return Integer.compare(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final long right) {", + " return Long.compare(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final float right) {", + " return Float.compare(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final double right) {", + " return Double.compare(left.intValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Byte right) {", + " return Integer.compare(left.intValue(), right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Short right) {", + " return Integer.compare(left.intValue(), right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Integer) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Integer right) {", + " return Integer.compare(left.intValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Long right) {", + " return Long.compare(left.intValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Float right) {", + " return Float.compare(left.intValue(), right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Integer, right : Double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final Double right) {", + " return Double.compare(left.intValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Integer, right : AtomicInteger) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final AtomicInteger right) {", + " return Integer.compare(left.intValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Integer, right : AtomicLong) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final AtomicLong right) {", + " return Long.compare(left.intValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Integer, right : AtomicDouble) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Integer left, final AtomicDouble right) {", + " return Double.compare(left.intValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/intprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/intprimitive/CodeTest.java new file mode 100644 index 0000000000..5e90034f95 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/intprimitive/CodeTest.java @@ -0,0 +1,198 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.intprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_equals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_greaterEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_greaterThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_lessEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_lessThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_notEquals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveIntComparisonExtensions.operator_spaceship; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static int left = 4; + + private static int left2 = 2; + + private static int right = 3; + + private static int right2 = 5; + + @Test + public void operator_greaterEqualsThan_int_Number() { + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessEqualsThan_int_Number() { + assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_greaterThan_int_Number() { + assertTrue(operator_greaterThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessThan_int_Number() { + assertFalse(operator_lessThan(left, new AtomicDouble(right))); + assertTrue(operator_lessThan(left2, new AtomicDouble(right))); + assertFalse(operator_lessThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_equals_int_Number() { + assertFalse(operator_equals(left, new AtomicDouble(right))); + assertFalse(operator_equals(left2, new AtomicDouble(right))); + assertTrue(operator_equals(left, new AtomicDouble(left))); + } + + @Test + public void operator_notEquals_int_Number() { + assertTrue(operator_notEquals(left, new AtomicDouble(right))); + assertTrue(operator_notEquals(left2, new AtomicDouble(right))); + assertFalse(operator_notEquals(left, new AtomicDouble(left))); + } + + @Test + public void operator_spaceship_int_byte() { + assertStrictlyPositive(operator_spaceship(left, (byte) right)); + assertStrictlyNegative(operator_spaceship(left, (byte) right2)); + assertZero(operator_spaceship(left, (byte) left)); + } + + @Test + public void operator_spaceship_int_short() { + assertStrictlyPositive(operator_spaceship(left, (short) right)); + assertStrictlyNegative(operator_spaceship(left, (short) right2)); + assertZero(operator_spaceship(left, (short) left)); + } + + @Test + public void operator_spaceship_int_int() { + assertStrictlyPositive(operator_spaceship(left, (int) right)); + assertStrictlyNegative(operator_spaceship(left, (int) right2)); + assertZero(operator_spaceship(left, (int) left)); + } + + @Test + public void operator_spaceship_int_long() { + assertStrictlyPositive(operator_spaceship(left, (long) right)); + assertStrictlyNegative(operator_spaceship(left, (long) right2)); + assertZero(operator_spaceship(left, (long) left)); + } + + @Test + public void operator_spaceship_int_float() { + assertStrictlyPositive(operator_spaceship(left, (float) right)); + assertStrictlyNegative(operator_spaceship(left, (float) right2)); + assertZero(operator_spaceship(left, (float) left)); + } + + @Test + public void operator_spaceship_int_double() { + assertStrictlyPositive(operator_spaceship(left, (double) right)); + assertStrictlyNegative(operator_spaceship(left, (double) right2)); + assertZero(operator_spaceship(left, (double) left)); + } + + @Test + public void operator_spaceship_int_Byte() { + assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); + assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); + assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); + } + + @Test + public void operator_spaceship_int_Short() { + assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); + assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); + assertZero(operator_spaceship(left, Short.valueOf((short) left))); + } + + @Test + public void operator_spaceship_int_Integer() { + assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); + assertZero(operator_spaceship(left, Integer.valueOf(left))); + } + + @Test + public void operator_spaceship_int_Long() { + assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); + assertZero(operator_spaceship(left, Long.valueOf(left))); + } + + @Test + public void operator_spaceship_int_Float() { + assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); + assertZero(operator_spaceship(left, Float.valueOf(left))); + } + + @Test + public void operator_spaceship_int_Double() { + assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); + assertZero(operator_spaceship(left, Double.valueOf(left))); + } + + @Test + public void operator_spaceship_int_AtomicInteger() { + assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); + assertZero(operator_spaceship(left, new AtomicInteger(left))); + } + + @Test + public void operator_spaceship_int_AtomicLong() { + assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); + assertZero(operator_spaceship(left, new AtomicLong(left))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/intprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/intprimitive/CompilerTest.java new file mode 100644 index 0000000000..7234476608 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/intprimitive/CompilerTest.java @@ -0,0 +1,3337 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.intprimitive; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_greaterThan_int_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final byte right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_int_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final short right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_int_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : int) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final int right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_int_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final long right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_int_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final float right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_int_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final double right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_int_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Byte right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_int_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Short right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_int_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Integer) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Integer right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_int_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Long right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_int_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Float right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_int_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Double right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_greaterThan_int_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : int, right : AtomicInteger) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicInteger right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_int_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : int, right : AtomicLong) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicLong right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_int_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int, right : AtomicDouble) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicDouble right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final byte right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final short right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : int) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final int right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final long right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final float right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final double right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Byte right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Short right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Integer) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Integer right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Long right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Float right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Double right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : int, right : AtomicInteger) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicInteger right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : int, right : AtomicLong) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicLong right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_int_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int, right : AtomicDouble) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicDouble right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final byte right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final short right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : int) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final int right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final long right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final float right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final double right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Byte right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Short right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Integer) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Integer right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Long right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Float right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Double right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : int, right : AtomicInteger) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicInteger right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : int, right : AtomicLong) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicLong right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_int_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int, right : AtomicDouble) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicDouble right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final byte right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final short right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : int) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final int right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final long right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final float right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final double right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Byte right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Short right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Integer) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Integer right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Long right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Float right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Double right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : int, right : AtomicInteger) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicInteger right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : int, right : AtomicLong) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicLong right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_int_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int, right : AtomicDouble) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicDouble right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final byte right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final short right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : int) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final int right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final long right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final float right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final double right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Byte right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Short right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Integer) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Integer right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Long right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Float right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Double right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : int, right : AtomicInteger) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicInteger right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : int, right : AtomicLong) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicLong right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_int_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int, right : AtomicDouble) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicDouble right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_notEquals_int_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final byte right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final short right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : int) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final int right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final long right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final float right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final double right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Byte right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Short right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Integer) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Integer right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Long right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Float right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final Double right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : int, right : AtomicInteger) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicInteger right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : int, right : AtomicLong) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicLong right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_int_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int, right : AtomicDouble) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final int left, final AtomicDouble right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final byte right) {", + " return Integer.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final short right) {", + " return Integer.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : int) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final int right) {", + " return Integer.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final long right) {", + " return Long.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final float right) {", + " return Float.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final double right) {", + " return Double.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Byte right) {", + " return Integer.compare(left, right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Short right) {", + " return Integer.compare(left, right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Integer) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Integer right) {", + " return Integer.compare(left, right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Long right) {", + " return Long.compare(left, right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Float right) {", + " return Float.compare(left, right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : int, right : Double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final Double right) {", + " return Double.compare(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : int, right : AtomicInteger) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final AtomicInteger right) {", + " return Integer.compare(left, right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : int, right : AtomicLong) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final AtomicLong right) {", + " return Long.compare(left, right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_int_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : int, right : AtomicDouble) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final int left, final AtomicDouble right) {", + " return Double.compare(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/longobject/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/longobject/CodeTest.java new file mode 100644 index 0000000000..0aeb4da83e --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/longobject/CodeTest.java @@ -0,0 +1,198 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.longobject; + +import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_equals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_greaterEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_greaterThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_lessEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_lessThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_notEquals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.LongComparisonExtensions.operator_spaceship; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Long left = 4l; + + private static Long left2 = 2l; + + private static int right = 3; + + private static int right2 = 5; + + @Test + public void operator_greaterEqualsThan_Byte_Number() { + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessEqualsThan_Byte_Number() { + assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_greaterThan_Byte_Number() { + assertTrue(operator_greaterThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessThan_Byte_Number() { + assertFalse(operator_lessThan(left, new AtomicDouble(right))); + assertTrue(operator_lessThan(left2, new AtomicDouble(right))); + assertFalse(operator_lessThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_equals_Byte_Number() { + assertFalse(operator_equals(left, new AtomicDouble(right))); + assertFalse(operator_equals(left2, new AtomicDouble(right))); + assertTrue(operator_equals(left, new AtomicDouble(left))); + } + + @Test + public void operator_notEquals_Byte_Number() { + assertTrue(operator_notEquals(left, new AtomicDouble(right))); + assertTrue(operator_notEquals(left2, new AtomicDouble(right))); + assertFalse(operator_notEquals(left, new AtomicDouble(left))); + } + + @Test + public void operator_spaceship_Byte_byte() { + assertStrictlyPositive(operator_spaceship(left, (byte) right)); + assertStrictlyNegative(operator_spaceship(left, (byte) right2)); + assertZero(operator_spaceship(left, left.byteValue())); + } + + @Test + public void operator_spaceship_Byte_short() { + assertStrictlyPositive(operator_spaceship(left, (short) right)); + assertStrictlyNegative(operator_spaceship(left, (short) right2)); + assertZero(operator_spaceship(left, (short) left.longValue())); + } + + @Test + public void operator_spaceship_Byte_int() { + assertStrictlyPositive(operator_spaceship(left, (int) right)); + assertStrictlyNegative(operator_spaceship(left, (int) right2)); + assertZero(operator_spaceship(left, (int) left.longValue())); + } + + @Test + public void operator_spaceship_Byte_long() { + assertStrictlyPositive(operator_spaceship(left, (long) right)); + assertStrictlyNegative(operator_spaceship(left, (long) right2)); + assertZero(operator_spaceship(left, (long) left)); + } + + @Test + public void operator_spaceship_Byte_float() { + assertStrictlyPositive(operator_spaceship(left, (float) right)); + assertStrictlyNegative(operator_spaceship(left, (float) right2)); + assertZero(operator_spaceship(left, (float) left)); + } + + @Test + public void operator_spaceship_Byte_double() { + assertStrictlyPositive(operator_spaceship(left, (double) right)); + assertStrictlyNegative(operator_spaceship(left, (double) right2)); + assertZero(operator_spaceship(left, (double) left)); + } + + @Test + public void operator_spaceship_Byte_Byte() { + assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); + assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); + assertZero(operator_spaceship(left, Byte.valueOf(left.byteValue()))); + } + + @Test + public void operator_spaceship_Byte_Short() { + assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); + assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); + assertZero(operator_spaceship(left, Short.valueOf((short) left.longValue()))); + } + + @Test + public void operator_spaceship_Byte_Integer() { + assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); + assertZero(operator_spaceship(left, Integer.valueOf(left.intValue()))); + } + + @Test + public void operator_spaceship_Byte_Long() { + assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); + assertZero(operator_spaceship(left, Long.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_Float() { + assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); + assertZero(operator_spaceship(left, Float.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_Double() { + assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); + assertZero(operator_spaceship(left, Double.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_AtomicInteger() { + assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); + assertZero(operator_spaceship(left, new AtomicInteger(left.intValue()))); + } + + @Test + public void operator_spaceship_Byte_AtomicLong() { + assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); + assertZero(operator_spaceship(left, new AtomicLong(left))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/longobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/longobject/CompilerTest.java new file mode 100644 index 0000000000..fe64da4cde --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/longobject/CompilerTest.java @@ -0,0 +1,3337 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.longobject; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_greaterThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final byte right) {", + " return (left.longValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final short right) {", + " return (left.longValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : int) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final int right) {", + " return (left.longValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final long right) {", + " return (left.longValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final float right) {", + " return (left.longValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final double right) {", + " return (left.longValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Byte right) {", + " return (left.longValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Short right) {", + " return (left.longValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Integer) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Integer right) {", + " return (left.longValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Long right) {", + " return (left.longValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Float right) {", + " return (left.longValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Double right) {", + " return (left.longValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_greaterThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Long, right : AtomicInteger) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicInteger right) {", + " return (left.longValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Long, right : AtomicLong) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicLong right) {", + " return (left.longValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long, right : AtomicDouble) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicDouble right) {", + " return (left.longValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final byte right) {", + " return (left.longValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final short right) {", + " return (left.longValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : int) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final int right) {", + " return (left.longValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final long right) {", + " return (left.longValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final float right) {", + " return (left.longValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final double right) {", + " return (left.longValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Byte right) {", + " return (left.longValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Short right) {", + " return (left.longValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Integer) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Integer right) {", + " return (left.longValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Long right) {", + " return (left.longValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Float right) {", + " return (left.longValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Double right) {", + " return (left.longValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Long, right : AtomicInteger) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicInteger right) {", + " return (left.longValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Long, right : AtomicLong) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicLong right) {", + " return (left.longValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long, right : AtomicDouble) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicDouble right) {", + " return (left.longValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final byte right) {", + " return (left.longValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final short right) {", + " return (left.longValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : int) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final int right) {", + " return (left.longValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final long right) {", + " return (left.longValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final float right) {", + " return (left.longValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final double right) {", + " return (left.longValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Byte right) {", + " return (left.longValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Short right) {", + " return (left.longValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Integer) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Integer right) {", + " return (left.longValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Long right) {", + " return (left.longValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Float right) {", + " return (left.longValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Double right) {", + " return (left.longValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Long, right : AtomicInteger) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicInteger right) {", + " return (left.longValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Long, right : AtomicLong) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicLong right) {", + " return (left.longValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long, right : AtomicDouble) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicDouble right) {", + " return (left.longValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final byte right) {", + " return (left.longValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final short right) {", + " return (left.longValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : int) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final int right) {", + " return (left.longValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final long right) {", + " return (left.longValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final float right) {", + " return (left.longValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final double right) {", + " return (left.longValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Byte right) {", + " return (left.longValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Short right) {", + " return (left.longValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Integer) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Integer right) {", + " return (left.longValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Long right) {", + " return (left.longValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Float right) {", + " return (left.longValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Double right) {", + " return (left.longValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Long, right : AtomicInteger) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicInteger right) {", + " return (left.longValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Long, right : AtomicLong) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicLong right) {", + " return (left.longValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long, right : AtomicDouble) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicDouble right) {", + " return (left.longValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final byte right) {", + " return (left != null && (left.longValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final short right) {", + " return (left != null && (left.longValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : int) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final int right) {", + " return (left != null && (left.longValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final long right) {", + " return (left != null && (left.longValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final float right) {", + " return (left != null && (left.longValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final double right) {", + " return (left != null && (left.longValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Byte right) {", + " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Short right) {", + " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Integer) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Integer right) {", + " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Long right) {", + " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Float right) {", + " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Double right) {", + " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Long, right : AtomicInteger) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicInteger right) {", + " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Long, right : AtomicLong) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicLong right) {", + " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long, right : AtomicDouble) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicDouble right) {", + " return (left == null ? (right == null) : (right != null && left.longValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_notEquals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final byte right) {", + " return (left == null || (left.longValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final short right) {", + " return (left == null || (left.longValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : int) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final int right) {", + " return (left == null || (left.longValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final long right) {", + " return (left == null || (left.longValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final float right) {", + " return (left == null || (left.longValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final double right) {", + " return (left == null || (left.longValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Byte right) {", + " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Short right) {", + " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Integer) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Integer right) {", + " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Long right) {", + " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Float right) {", + " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final Double right) {", + " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Long, right : AtomicInteger) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicInteger right) {", + " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Long, right : AtomicLong) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicLong right) {", + " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long, right : AtomicDouble) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Long left, final AtomicDouble right) {", + " return (left == null ? (right != null) : (right == null || left.longValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final byte right) {", + " return Long.compare(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final short right) {", + " return Long.compare(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : int) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final int right) {", + " return Long.compare(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final long right) {", + " return Long.compare(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final float right) {", + " return Float.compare(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final double right) {", + " return Double.compare(left.longValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final Byte right) {", + " return Long.compare(left.longValue(), right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final Short right) {", + " return Long.compare(left.longValue(), right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Integer) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final Integer right) {", + " return Long.compare(left.longValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final Long right) {", + " return Long.compare(left.longValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final Float right) {", + " return Float.compare(left.longValue(), right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Long, right : Double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final Double right) {", + " return Double.compare(left.longValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Long, right : AtomicInteger) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final AtomicInteger right) {", + " return Long.compare(left.longValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Long, right : AtomicLong) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final AtomicLong right) {", + " return Long.compare(left.longValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Long, right : AtomicDouble) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Long left, final AtomicDouble right) {", + " return Double.compare(left.longValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/longprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/longprimitive/CodeTest.java new file mode 100644 index 0000000000..720559a13e --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/longprimitive/CodeTest.java @@ -0,0 +1,198 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.longprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_equals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_greaterEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_greaterThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_lessEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_lessThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_notEquals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveLongComparisonExtensions.operator_spaceship; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static short left = 4; + + private static short left2 = 2; + + private static int right = 3; + + private static int right2 = 5; + + @Test + public void operator_greaterEqualsThan_short_Number() { + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessEqualsThan_short_Number() { + assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_greaterThan_short_Number() { + assertTrue(operator_greaterThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessThan_short_Number() { + assertFalse(operator_lessThan(left, new AtomicDouble(right))); + assertTrue(operator_lessThan(left2, new AtomicDouble(right))); + assertFalse(operator_lessThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_equals_short_Number() { + assertFalse(operator_equals(left, new AtomicDouble(right))); + assertFalse(operator_equals(left2, new AtomicDouble(right))); + assertTrue(operator_equals(left, new AtomicDouble(left))); + } + + @Test + public void operator_notEquals_short_Number() { + assertTrue(operator_notEquals(left, new AtomicDouble(right))); + assertTrue(operator_notEquals(left2, new AtomicDouble(right))); + assertFalse(operator_notEquals(left, new AtomicDouble(left))); + } + + @Test + public void operator_spaceship_short_byte() { + assertStrictlyPositive(operator_spaceship(left, (byte) right)); + assertStrictlyNegative(operator_spaceship(left, (byte) right2)); + assertZero(operator_spaceship(left, (byte) left)); + } + + @Test + public void operator_spaceship_short_short() { + assertStrictlyPositive(operator_spaceship(left, (short) right)); + assertStrictlyNegative(operator_spaceship(left, (short) right2)); + assertZero(operator_spaceship(left, (short) left)); + } + + @Test + public void operator_spaceship_short_int() { + assertStrictlyPositive(operator_spaceship(left, (int) right)); + assertStrictlyNegative(operator_spaceship(left, (int) right2)); + assertZero(operator_spaceship(left, (int) left)); + } + + @Test + public void operator_spaceship_short_long() { + assertStrictlyPositive(operator_spaceship(left, (long) right)); + assertStrictlyNegative(operator_spaceship(left, (long) right2)); + assertZero(operator_spaceship(left, (long) left)); + } + + @Test + public void operator_spaceship_short_float() { + assertStrictlyPositive(operator_spaceship(left, (float) right)); + assertStrictlyNegative(operator_spaceship(left, (float) right2)); + assertZero(operator_spaceship(left, (float) left)); + } + + @Test + public void operator_spaceship_short_double() { + assertStrictlyPositive(operator_spaceship(left, (double) right)); + assertStrictlyNegative(operator_spaceship(left, (double) right2)); + assertZero(operator_spaceship(left, (double) left)); + } + + @Test + public void operator_spaceship_short_Byte() { + assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); + assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); + assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); + } + + @Test + public void operator_spaceship_short_Short() { + assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); + assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); + assertZero(operator_spaceship(left, Short.valueOf((short) left))); + } + + @Test + public void operator_spaceship_short_Integer() { + assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); + assertZero(operator_spaceship(left, Integer.valueOf(left))); + } + + @Test + public void operator_spaceship_short_Long() { + assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); + assertZero(operator_spaceship(left, Long.valueOf(left))); + } + + @Test + public void operator_spaceship_short_Float() { + assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); + assertZero(operator_spaceship(left, Float.valueOf(left))); + } + + @Test + public void operator_spaceship_short_Double() { + assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); + assertZero(operator_spaceship(left, Double.valueOf(left))); + } + + @Test + public void operator_spaceship_short_AtomicInteger() { + assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); + assertZero(operator_spaceship(left, new AtomicInteger(left))); + } + + @Test + public void operator_spaceship_short_AtomicLong() { + assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); + assertZero(operator_spaceship(left, new AtomicLong(left))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/longprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/longprimitive/CompilerTest.java new file mode 100644 index 0000000000..da0035d275 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/longprimitive/CompilerTest.java @@ -0,0 +1,3337 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.longprimitive; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_greaterThan_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final byte right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final short right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final int right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final long right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final float right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final double right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Byte right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Short right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Integer right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Long right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Float right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Double right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_greaterThan_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicInteger right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicLong right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicDouble right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final byte right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final short right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final int right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final long right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final float right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final double right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Byte right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Short right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Integer right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Long right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Float right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Double right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicInteger right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicLong right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicDouble right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final byte right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final short right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final int right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final long right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final float right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final double right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Byte right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Short right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Integer right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Long right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Float right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Double right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicInteger right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicLong right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicDouble right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final byte right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final short right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final int right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final long right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final float right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final double right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Byte right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Short right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Integer right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Long right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Float right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Double right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicInteger right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicLong right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicDouble right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final byte right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final short right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final int right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final long right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final float right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final double right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Byte right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Short right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Integer right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Long right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Float right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Double right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicInteger right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicLong right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicDouble right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_notEquals_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final byte right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final short right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final int right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final long right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final float right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final double right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Byte right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Short right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Integer right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Long right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Float right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Double right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicInteger right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicLong right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicDouble right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final byte right) {", + " return Short.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final short right) {", + " return Short.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final int right) {", + " return Integer.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final long right) {", + " return Long.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final float right) {", + " return Float.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final double right) {", + " return Double.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Byte right) {", + " return Short.compare(left, right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Short right) {", + " return Short.compare(left, right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Integer right) {", + " return Integer.compare(left, right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Long right) {", + " return Long.compare(left, right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Float right) {", + " return Float.compare(left, right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Double right) {", + " return Double.compare(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final AtomicInteger right) {", + " return Integer.compare(left, right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final AtomicLong right) {", + " return Long.compare(left, right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final AtomicDouble right) {", + " return Double.compare(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/number/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/number/CodeTest.java new file mode 100644 index 0000000000..a8a9204f8f --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/number/CodeTest.java @@ -0,0 +1,198 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.number; + +import static io.sarl.lang.scoping.extensions.numbers.comparison.NumberComparisonExtensions.operator_equals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.NumberComparisonExtensions.operator_greaterEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.NumberComparisonExtensions.operator_greaterThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.NumberComparisonExtensions.operator_lessEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.NumberComparisonExtensions.operator_lessThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.NumberComparisonExtensions.operator_notEquals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.NumberComparisonExtensions.operator_spaceship; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Number left = new AtomicDouble(4.); + + private static Number left2 = new AtomicDouble(2.); + + private static int right = 3; + + private static int right2 = 5; + + @Test + public void operator_greaterEqualsThan_Byte_Number() { + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left.doubleValue()))); + } + + @Test + public void operator_lessEqualsThan_Byte_Number() { + assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left.doubleValue()))); + } + + @Test + public void operator_greaterThan_Byte_Number() { + assertTrue(operator_greaterThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left, new AtomicDouble(left.doubleValue()))); + } + + @Test + public void operator_lessThan_Byte_Number() { + assertFalse(operator_lessThan(left, new AtomicDouble(right))); + assertTrue(operator_lessThan(left2, new AtomicDouble(right))); + assertFalse(operator_lessThan(left, new AtomicDouble(left.doubleValue()))); + } + + @Test + public void operator_equals_Byte_Number() { + assertFalse(operator_equals(left, new AtomicDouble(right))); + assertFalse(operator_equals(left2, new AtomicDouble(right))); + assertTrue(operator_equals(left, new AtomicDouble(left.doubleValue()))); + } + + @Test + public void operator_notEquals_Byte_Number() { + assertTrue(operator_notEquals(left, new AtomicDouble(right))); + assertTrue(operator_notEquals(left2, new AtomicDouble(right))); + assertFalse(operator_notEquals(left, new AtomicDouble(left.doubleValue()))); + } + + @Test + public void operator_spaceship_Byte_byte() { + assertStrictlyPositive(operator_spaceship(left, (byte) right)); + assertStrictlyNegative(operator_spaceship(left, (byte) right2)); + assertZero(operator_spaceship(left, left.byteValue())); + } + + @Test + public void operator_spaceship_Byte_short() { + assertStrictlyPositive(operator_spaceship(left, (short) right)); + assertStrictlyNegative(operator_spaceship(left, (short) right2)); + assertZero(operator_spaceship(left, (short) left.doubleValue())); + } + + @Test + public void operator_spaceship_Byte_int() { + assertStrictlyPositive(operator_spaceship(left, (int) right)); + assertStrictlyNegative(operator_spaceship(left, (int) right2)); + assertZero(operator_spaceship(left, (int) left.doubleValue())); + } + + @Test + public void operator_spaceship_Byte_long() { + assertStrictlyPositive(operator_spaceship(left, (long) right)); + assertStrictlyNegative(operator_spaceship(left, (long) right2)); + assertZero(operator_spaceship(left, (long) left.longValue())); + } + + @Test + public void operator_spaceship_Byte_float() { + assertStrictlyPositive(operator_spaceship(left, (float) right)); + assertStrictlyNegative(operator_spaceship(left, (float) right2)); + assertZero(operator_spaceship(left, (float) left.floatValue())); + } + + @Test + public void operator_spaceship_Byte_double() { + assertStrictlyPositive(operator_spaceship(left, (double) right)); + assertStrictlyNegative(operator_spaceship(left, (double) right2)); + assertZero(operator_spaceship(left, (double) left.doubleValue())); + } + + @Test + public void operator_spaceship_Byte_Byte() { + assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); + assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); + assertZero(operator_spaceship(left, Byte.valueOf(left.byteValue()))); + } + + @Test + public void operator_spaceship_Byte_Short() { + assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); + assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); + assertZero(operator_spaceship(left, Short.valueOf((short) left.doubleValue()))); + } + + @Test + public void operator_spaceship_Byte_Integer() { + assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); + assertZero(operator_spaceship(left, Integer.valueOf(left.intValue()))); + } + + @Test + public void operator_spaceship_Byte_Long() { + assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); + assertZero(operator_spaceship(left, Long.valueOf(left.longValue()))); + } + + @Test + public void operator_spaceship_Byte_Float() { + assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); + assertZero(operator_spaceship(left, Float.valueOf(left.floatValue()))); + } + + @Test + public void operator_spaceship_Byte_Double() { + assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); + assertZero(operator_spaceship(left, Double.valueOf(left.doubleValue()))); + } + + @Test + public void operator_spaceship_Byte_AtomicInteger() { + assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); + assertZero(operator_spaceship(left, new AtomicInteger(left.intValue()))); + } + + @Test + public void operator_spaceship_Byte_AtomicLong() { + assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); + assertZero(operator_spaceship(left, new AtomicLong(left.longValue()))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/number/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/number/CompilerTest.java new file mode 100644 index 0000000000..e010cc1df0 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/number/CompilerTest.java @@ -0,0 +1,3337 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.number; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_greaterThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final byte right) {", + " return (left.doubleValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final short right) {", + " return (left.doubleValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : int) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final int right) {", + " return (left.doubleValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final long right) {", + " return (left.doubleValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final float right) {", + " return (left.doubleValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final double right) {", + " return (left.doubleValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Byte right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Short right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Integer) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Integer right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Long right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Float right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Double right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_greaterThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Number, right : AtomicInteger) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicInteger right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Number, right : AtomicLong) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicLong right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number, right : AtomicDouble) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicDouble right) {", + " return (left.doubleValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final byte right) {", + " return (left.doubleValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final short right) {", + " return (left.doubleValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : int) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final int right) {", + " return (left.doubleValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final long right) {", + " return (left.doubleValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final float right) {", + " return (left.doubleValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final double right) {", + " return (left.doubleValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Byte right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Short right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Integer) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Integer right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Long right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Float right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Double right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Number, right : AtomicInteger) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicInteger right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Number, right : AtomicLong) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicLong right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number, right : AtomicDouble) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicDouble right) {", + " return (left.doubleValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final byte right) {", + " return (left.doubleValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final short right) {", + " return (left.doubleValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : int) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final int right) {", + " return (left.doubleValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final long right) {", + " return (left.doubleValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final float right) {", + " return (left.doubleValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final double right) {", + " return (left.doubleValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Byte right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Short right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Integer) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Integer right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Long right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Float right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Double right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Number, right : AtomicInteger) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicInteger right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Number, right : AtomicLong) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicLong right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number, right : AtomicDouble) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicDouble right) {", + " return (left.doubleValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final byte right) {", + " return (left.doubleValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final short right) {", + " return (left.doubleValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : int) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final int right) {", + " return (left.doubleValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final long right) {", + " return (left.doubleValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final float right) {", + " return (left.doubleValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final double right) {", + " return (left.doubleValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Byte right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Short right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Integer) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Integer right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Long right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Float right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Double right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Number, right : AtomicInteger) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicInteger right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Number, right : AtomicLong) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicLong right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number, right : AtomicDouble) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicDouble right) {", + " return (left.doubleValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final byte right) {", + " return (left != null && (left.doubleValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final short right) {", + " return (left != null && (left.doubleValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : int) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final int right) {", + " return (left != null && (left.doubleValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final long right) {", + " return (left != null && (left.doubleValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final float right) {", + " return (left != null && (left.doubleValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final double right) {", + " return (left != null && (left.doubleValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Byte right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Short right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Integer) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Integer right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Long right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Float right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Double right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Number, right : AtomicInteger) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicInteger right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Number, right : AtomicLong) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicLong right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number, right : AtomicDouble) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicDouble right) {", + " return (left == null ? (right == null) : (right != null && left.doubleValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_notEquals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final byte right) {", + " return (left == null || (left.doubleValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final short right) {", + " return (left == null || (left.doubleValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : int) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final int right) {", + " return (left == null || (left.doubleValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final long right) {", + " return (left == null || (left.doubleValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final float right) {", + " return (left == null || (left.doubleValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final double right) {", + " return (left == null || (left.doubleValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Byte right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Short right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Integer) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Integer right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Long right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Float right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final Double right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Number, right : AtomicInteger) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicInteger right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Number, right : AtomicLong) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicLong right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number, right : AtomicDouble) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Number left, final AtomicDouble right) {", + " return (left == null ? (right != null) : (right == null || left.doubleValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final byte right) {", + " return Double.compare(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final short right) {", + " return Double.compare(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : int) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final int right) {", + " return Double.compare(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final long right) {", + " return Double.compare(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final float right) {", + " return Double.compare(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final double right) {", + " return Double.compare(left.doubleValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final Byte right) {", + " return Double.compare(left.doubleValue(), right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final Short right) {", + " return Double.compare(left.doubleValue(), right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Integer) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final Integer right) {", + " return Double.compare(left.doubleValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final Long right) {", + " return Double.compare(left.doubleValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final Float right) {", + " return Double.compare(left.doubleValue(), right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Number, right : Double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final Double right) {", + " return Double.compare(left.doubleValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Number, right : AtomicInteger) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final AtomicInteger right) {", + " return Double.compare(left.doubleValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Number, right : AtomicLong) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final AtomicLong right) {", + " return Double.compare(left.doubleValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Number, right : AtomicDouble) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Number left, final AtomicDouble right) {", + " return Double.compare(left.doubleValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/shortobject/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/shortobject/CodeTest.java new file mode 100644 index 0000000000..c5fcdda5d7 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/shortobject/CodeTest.java @@ -0,0 +1,198 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.shortobject; + +import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_equals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_greaterEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_greaterThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_lessEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_lessThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_notEquals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.ShortComparisonExtensions.operator_spaceship; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static Short left = 4; + + private static Short left2 = 2; + + private static int right = 3; + + private static int right2 = 5; + + @Test + public void operator_greaterEqualsThan_Byte_Number() { + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessEqualsThan_Byte_Number() { + assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_greaterThan_Byte_Number() { + assertTrue(operator_greaterThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessThan_Byte_Number() { + assertFalse(operator_lessThan(left, new AtomicDouble(right))); + assertTrue(operator_lessThan(left2, new AtomicDouble(right))); + assertFalse(operator_lessThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_equals_Byte_Number() { + assertFalse(operator_equals(left, new AtomicDouble(right))); + assertFalse(operator_equals(left2, new AtomicDouble(right))); + assertTrue(operator_equals(left, new AtomicDouble(left))); + } + + @Test + public void operator_notEquals_Byte_Number() { + assertTrue(operator_notEquals(left, new AtomicDouble(right))); + assertTrue(operator_notEquals(left2, new AtomicDouble(right))); + assertFalse(operator_notEquals(left, new AtomicDouble(left))); + } + + @Test + public void operator_spaceship_Byte_byte() { + assertStrictlyPositive(operator_spaceship(left, (byte) right)); + assertStrictlyNegative(operator_spaceship(left, (byte) right2)); + assertZero(operator_spaceship(left, left.byteValue())); + } + + @Test + public void operator_spaceship_Byte_short() { + assertStrictlyPositive(operator_spaceship(left, (short) right)); + assertStrictlyNegative(operator_spaceship(left, (short) right2)); + assertZero(operator_spaceship(left, (short) left)); + } + + @Test + public void operator_spaceship_Byte_int() { + assertStrictlyPositive(operator_spaceship(left, (int) right)); + assertStrictlyNegative(operator_spaceship(left, (int) right2)); + assertZero(operator_spaceship(left, (int) left)); + } + + @Test + public void operator_spaceship_Byte_long() { + assertStrictlyPositive(operator_spaceship(left, (long) right)); + assertStrictlyNegative(operator_spaceship(left, (long) right2)); + assertZero(operator_spaceship(left, (long) left)); + } + + @Test + public void operator_spaceship_Byte_float() { + assertStrictlyPositive(operator_spaceship(left, (float) right)); + assertStrictlyNegative(operator_spaceship(left, (float) right2)); + assertZero(operator_spaceship(left, (float) left)); + } + + @Test + public void operator_spaceship_Byte_double() { + assertStrictlyPositive(operator_spaceship(left, (double) right)); + assertStrictlyNegative(operator_spaceship(left, (double) right2)); + assertZero(operator_spaceship(left, (double) left)); + } + + @Test + public void operator_spaceship_Byte_Byte() { + assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); + assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); + assertZero(operator_spaceship(left, Byte.valueOf(left.byteValue()))); + } + + @Test + public void operator_spaceship_Byte_Short() { + assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); + assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); + assertZero(operator_spaceship(left, Short.valueOf((short) left))); + } + + @Test + public void operator_spaceship_Byte_Integer() { + assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); + assertZero(operator_spaceship(left, Integer.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_Long() { + assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); + assertZero(operator_spaceship(left, Long.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_Float() { + assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); + assertZero(operator_spaceship(left, Float.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_Double() { + assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); + assertZero(operator_spaceship(left, Double.valueOf(left))); + } + + @Test + public void operator_spaceship_Byte_AtomicInteger() { + assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); + assertZero(operator_spaceship(left, new AtomicInteger(left))); + } + + @Test + public void operator_spaceship_Byte_AtomicLong() { + assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); + assertZero(operator_spaceship(left, new AtomicLong(left))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/shortobject/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/shortobject/CompilerTest.java new file mode 100644 index 0000000000..8c2a811679 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/shortobject/CompilerTest.java @@ -0,0 +1,3337 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.shortobject; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_greaterThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final byte right) {", + " return (left.shortValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final short right) {", + " return (left.shortValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : int) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final int right) {", + " return (left.shortValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final long right) {", + " return (left.shortValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final float right) {", + " return (left.shortValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final double right) {", + " return (left.shortValue() > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Byte right) {", + " return (left.shortValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Short right) {", + " return (left.shortValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Integer) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Integer right) {", + " return (left.shortValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Long right) {", + " return (left.shortValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Float right) {", + " return (left.shortValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Double right) {", + " return (left.shortValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_greaterThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Short, right : AtomicInteger) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicInteger right) {", + " return (left.shortValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Short, right : AtomicLong) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicLong right) {", + " return (left.shortValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short, right : AtomicDouble) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicDouble right) {", + " return (left.shortValue() > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final byte right) {", + " return (left.shortValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final short right) {", + " return (left.shortValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : int) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final int right) {", + " return (left.shortValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final long right) {", + " return (left.shortValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final float right) {", + " return (left.shortValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final double right) {", + " return (left.shortValue() >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Byte right) {", + " return (left.shortValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Short right) {", + " return (left.shortValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Integer) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Integer right) {", + " return (left.shortValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Long right) {", + " return (left.shortValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Float right) {", + " return (left.shortValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Double right) {", + " return (left.shortValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Short, right : AtomicInteger) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicInteger right) {", + " return (left.shortValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Short, right : AtomicLong) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicLong right) {", + " return (left.shortValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short, right : AtomicDouble) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicDouble right) {", + " return (left.shortValue() >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final byte right) {", + " return (left.shortValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final short right) {", + " return (left.shortValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : int) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final int right) {", + " return (left.shortValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final long right) {", + " return (left.shortValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final float right) {", + " return (left.shortValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final double right) {", + " return (left.shortValue() < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Byte right) {", + " return (left.shortValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Short right) {", + " return (left.shortValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Integer) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Integer right) {", + " return (left.shortValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Long right) {", + " return (left.shortValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Float right) {", + " return (left.shortValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Double right) {", + " return (left.shortValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Short, right : AtomicInteger) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicInteger right) {", + " return (left.shortValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Short, right : AtomicLong) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicLong right) {", + " return (left.shortValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short, right : AtomicDouble) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicDouble right) {", + " return (left.shortValue() < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final byte right) {", + " return (left.shortValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final short right) {", + " return (left.shortValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : int) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final int right) {", + " return (left.shortValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final long right) {", + " return (left.shortValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final float right) {", + " return (left.shortValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final double right) {", + " return (left.shortValue() <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Byte right) {", + " return (left.shortValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Short right) {", + " return (left.shortValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Integer) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Integer right) {", + " return (left.shortValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Long right) {", + " return (left.shortValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Float right) {", + " return (left.shortValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Double right) {", + " return (left.shortValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Short, right : AtomicInteger) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicInteger right) {", + " return (left.shortValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Short, right : AtomicLong) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicLong right) {", + " return (left.shortValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short, right : AtomicDouble) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicDouble right) {", + " return (left.shortValue() <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final byte right) {", + " return (left != null && (left.shortValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final short right) {", + " return (left != null && (left.shortValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : int) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final int right) {", + " return (left != null && (left.shortValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final long right) {", + " return (left != null && (left.shortValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final float right) {", + " return (left != null && (left.shortValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final double right) {", + " return (left != null && (left.shortValue() == right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Byte right) {", + " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Short right) {", + " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Integer) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Integer right) {", + " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Long right) {", + " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Float right) {", + " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Double right) {", + " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Short, right : AtomicInteger) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicInteger right) {", + " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Short, right : AtomicLong) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicLong right) {", + " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short, right : AtomicDouble) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicDouble right) {", + " return (left == null ? (right == null) : (right != null && left.shortValue() == right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_notEquals_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final byte right) {", + " return (left == null || (left.shortValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final short right) {", + " return (left == null || (left.shortValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : int) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final int right) {", + " return (left == null || (left.shortValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final long right) {", + " return (left == null || (left.shortValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final float right) {", + " return (left == null || (left.shortValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final double right) {", + " return (left == null || (left.shortValue() != right));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Byte right) {", + " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Short right) {", + " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Integer) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Integer right) {", + " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Long right) {", + " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Float right) {", + " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final Double right) {", + " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Short, right : AtomicInteger) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicInteger right) {", + " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Short, right : AtomicLong) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicLong right) {", + " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short, right : AtomicDouble) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final Short left, final AtomicDouble right) {", + " return (left == null ? (right != null) : (right == null || left.shortValue() != right.doubleValue()));", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final byte right) {", + " return Short.compare(left.shortValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final short right) {", + " return Short.compare(left.shortValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : int) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final int right) {", + " return Integer.compare(left.shortValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final long right) {", + " return Long.compare(left.shortValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final float right) {", + " return Float.compare(left.shortValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final double right) {", + " return Double.compare(left.shortValue(), right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Byte right) {", + " return Short.compare(left.shortValue(), right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Short right) {", + " return Short.compare(left.shortValue(), right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Integer) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Integer right) {", + " return Integer.compare(left.shortValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Long right) {", + " return Long.compare(left.shortValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Float right) {", + " return Float.compare(left.shortValue(), right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : Short, right : Double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final Double right) {", + " return Double.compare(left.shortValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : Short, right : AtomicInteger) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final AtomicInteger right) {", + " return Integer.compare(left.shortValue(), right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : Short, right : AtomicLong) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final AtomicLong right) {", + " return Long.compare(left.shortValue(), right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_Byte_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : Short, right : AtomicDouble) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final Short left, final AtomicDouble right) {", + " return Double.compare(left.shortValue(), right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/shortprimitive/CodeTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/shortprimitive/CodeTest.java new file mode 100644 index 0000000000..e108b09f53 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/shortprimitive/CodeTest.java @@ -0,0 +1,198 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.shortprimitive; + +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_equals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_greaterEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_greaterThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_lessEqualsThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_lessThan; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_notEquals; +import static io.sarl.lang.scoping.extensions.numbers.comparison.PrimitiveShortComparisonExtensions.operator_spaceship; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.util.concurrent.AtomicDouble; +import org.junit.Test; + +import io.sarl.tests.api.AbstractSarlTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CodeTest extends AbstractSarlTest { + + private static short left = 4; + + private static short left2 = 2; + + private static int right = 3; + + private static int right2 = 5; + + @Test + public void operator_greaterEqualsThan_short_Number() { + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_greaterEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessEqualsThan_short_Number() { + assertFalse(operator_lessEqualsThan(left, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left2, new AtomicDouble(right))); + assertTrue(operator_lessEqualsThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_greaterThan_short_Number() { + assertTrue(operator_greaterThan(left, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left2, new AtomicDouble(right))); + assertFalse(operator_greaterThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_lessThan_short_Number() { + assertFalse(operator_lessThan(left, new AtomicDouble(right))); + assertTrue(operator_lessThan(left2, new AtomicDouble(right))); + assertFalse(operator_lessThan(left, new AtomicDouble(left))); + } + + @Test + public void operator_equals_short_Number() { + assertFalse(operator_equals(left, new AtomicDouble(right))); + assertFalse(operator_equals(left2, new AtomicDouble(right))); + assertTrue(operator_equals(left, new AtomicDouble(left))); + } + + @Test + public void operator_notEquals_short_Number() { + assertTrue(operator_notEquals(left, new AtomicDouble(right))); + assertTrue(operator_notEquals(left2, new AtomicDouble(right))); + assertFalse(operator_notEquals(left, new AtomicDouble(left))); + } + + @Test + public void operator_spaceship_short_byte() { + assertStrictlyPositive(operator_spaceship(left, (byte) right)); + assertStrictlyNegative(operator_spaceship(left, (byte) right2)); + assertZero(operator_spaceship(left, (byte) left)); + } + + @Test + public void operator_spaceship_short_short() { + assertStrictlyPositive(operator_spaceship(left, (short) right)); + assertStrictlyNegative(operator_spaceship(left, (short) right2)); + assertZero(operator_spaceship(left, (short) left)); + } + + @Test + public void operator_spaceship_short_int() { + assertStrictlyPositive(operator_spaceship(left, (int) right)); + assertStrictlyNegative(operator_spaceship(left, (int) right2)); + assertZero(operator_spaceship(left, (int) left)); + } + + @Test + public void operator_spaceship_short_long() { + assertStrictlyPositive(operator_spaceship(left, (long) right)); + assertStrictlyNegative(operator_spaceship(left, (long) right2)); + assertZero(operator_spaceship(left, (long) left)); + } + + @Test + public void operator_spaceship_short_float() { + assertStrictlyPositive(operator_spaceship(left, (float) right)); + assertStrictlyNegative(operator_spaceship(left, (float) right2)); + assertZero(operator_spaceship(left, (float) left)); + } + + @Test + public void operator_spaceship_short_double() { + assertStrictlyPositive(operator_spaceship(left, (double) right)); + assertStrictlyNegative(operator_spaceship(left, (double) right2)); + assertZero(operator_spaceship(left, (double) left)); + } + + @Test + public void operator_spaceship_short_Byte() { + assertStrictlyPositive(operator_spaceship(left, Byte.valueOf((byte) right))); + assertStrictlyNegative(operator_spaceship(left, Byte.valueOf((byte) right2))); + assertZero(operator_spaceship(left, Byte.valueOf((byte) left))); + } + + @Test + public void operator_spaceship_short_Short() { + assertStrictlyPositive(operator_spaceship(left, Short.valueOf((short) right))); + assertStrictlyNegative(operator_spaceship(left, Short.valueOf((short) right2))); + assertZero(operator_spaceship(left, Short.valueOf((short) left))); + } + + @Test + public void operator_spaceship_short_Integer() { + assertStrictlyPositive(operator_spaceship(left, Integer.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Integer.valueOf(right2))); + assertZero(operator_spaceship(left, Integer.valueOf(left))); + } + + @Test + public void operator_spaceship_short_Long() { + assertStrictlyPositive(operator_spaceship(left, Long.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Long.valueOf(right2))); + assertZero(operator_spaceship(left, Long.valueOf(left))); + } + + @Test + public void operator_spaceship_short_Float() { + assertStrictlyPositive(operator_spaceship(left, Float.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Float.valueOf(right2))); + assertZero(operator_spaceship(left, Float.valueOf(left))); + } + + @Test + public void operator_spaceship_short_Double() { + assertStrictlyPositive(operator_spaceship(left, Double.valueOf(right))); + assertStrictlyNegative(operator_spaceship(left, Double.valueOf(right2))); + assertZero(operator_spaceship(left, Double.valueOf(left))); + } + + @Test + public void operator_spaceship_short_AtomicInteger() { + assertStrictlyPositive(operator_spaceship(left, new AtomicInteger(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicInteger(right2))); + assertZero(operator_spaceship(left, new AtomicInteger(left))); + } + + @Test + public void operator_spaceship_short_AtomicLong() { + assertStrictlyPositive(operator_spaceship(left, new AtomicLong(right))); + assertStrictlyNegative(operator_spaceship(left, new AtomicLong(right2))); + assertZero(operator_spaceship(left, new AtomicLong(left))); + } + +} diff --git a/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/shortprimitive/CompilerTest.java b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/shortprimitive/CompilerTest.java new file mode 100644 index 0000000000..c11e057e25 --- /dev/null +++ b/tests/io.sarl.lang.core.tests/src/test/java/io/sarl/lang/core/tests/scoping/extensions/numbers/comparison/shortprimitive/CompilerTest.java @@ -0,0 +1,3337 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.core.tests.scoping.extensions.numbers.comparison.shortprimitive; + +import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; +import io.sarl.tests.api.AbstractMassiveCompilationTest; + +/** + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @see "https://github.com/eclipse/xtext-extras/issues/186" + */ +@SuppressWarnings("all") +public class CompilerTest extends AbstractMassiveCompilationTest { + + @DifferedTest + public void operator_greaterThan_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final byte right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final short right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final int right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final long right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final float right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final double right) {", + " return (left > right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Byte right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Short right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Integer right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Long right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Float right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Double right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_greaterThan_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicInteger right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicLong right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterThan_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : boolean {", + " left > right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicDouble right) {", + " return (left > right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final byte right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final short right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final int right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final long right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final float right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final double right) {", + " return (left >= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Byte right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Short right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Integer right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Long right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Float right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Double right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicInteger right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicLong right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_greaterEqualsThan_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : boolean {", + " left >= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicDouble right) {", + " return (left >= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final byte right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final short right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final int right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final long right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final float right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final double right) {", + " return (left < right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Byte right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Short right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Integer right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Long right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Float right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Double right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicInteger right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicLong right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerThan_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : boolean {", + " left < right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicDouble right) {", + " return (left < right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final byte right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final short right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final int right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final long right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final float right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final double right) {", + " return (left <= right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Byte right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Short right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Integer right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Long right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Float right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Double right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicInteger right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicLong right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_lowerEqualsThan_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : boolean {", + " left <= right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicDouble right) {", + " return (left <= right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final byte right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final short right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final int right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final long right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final float right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final double right) {", + " return (left == right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Byte right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Short right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Integer right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Long right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Float right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Double right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicInteger right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicLong right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_equals_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : boolean {", + " left == right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicDouble right) {", + " return (right != null && left == right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + + @DifferedTest + public void operator_notEquals_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final byte right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final short right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final int right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final long right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final float right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final double right) {", + " return (left != right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Byte right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Short right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Integer right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Long right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Float right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final Double right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicInteger right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicLong right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_notEquals_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : boolean {", + " left != right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public boolean fct(final short left, final AtomicDouble right) {", + " return (right == null || left != right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final byte right) {", + " return Short.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final short right) {", + " return Short.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_int() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : int) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final int right) {", + " return Integer.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final long right) {", + " return Long.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final float right) {", + " return Float.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final double right) {", + " return Double.compare(left, right);", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Byte() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Byte) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Byte right) {", + " return Short.compare(left, right.byteValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Short() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Short) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Short right) {", + " return Short.compare(left, right.shortValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Integer() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Integer) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Integer right) {", + " return Integer.compare(left, right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Long() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Long) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Long right) {", + " return Long.compare(left, right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Float() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Float) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Float right) {", + " return Float.compare(left, right.floatValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Double() throws Exception { + diffSingleTypeCompileTo(multilineString( + "class A {", + " def fct(left : short, right : Double) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final Double right) {", + " return Double.compare(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_AtomicInteger() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicInteger", + "class A {", + " def fct(left : short, right : AtomicInteger) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicInteger;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final AtomicInteger right) {", + " return Integer.compare(left, right.intValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_AtomicLong() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import java.util.concurrent.atomic.AtomicLong", + "class A {", + " def fct(left : short, right : AtomicLong) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import java.util.concurrent.atomic.AtomicLong;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final AtomicLong right) {", + " return Long.compare(left, right.longValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + + @DifferedTest + public void operator_spaceship_short_Number() throws Exception { + diffSingleTypeCompileTo(multilineString( + "import com.google.common.util.concurrent.AtomicDouble", + "class A {", + " def fct(left : short, right : AtomicDouble) : int {", + " left <=> right", + " }", + "}"), + multilineString( + "import com.google.common.util.concurrent.AtomicDouble;", + "import io.sarl.lang.annotation.SarlElementType;", + "import io.sarl.lang.annotation.SarlSpecification;", + "import io.sarl.lang.annotation.SyntheticMember;", + "import org.eclipse.xtext.xbase.lib.Pure;", + "", + "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", + "@SuppressWarnings(\"all\")", + "public class A {", + " @Pure", + " public int fct(final short left, final AtomicDouble right) {", + " return Double.compare(left, right.doubleValue());", + " }", + " ", + " @SyntheticMember", + " public A() {", + " super();", + " }", + "}", + "")); + } + +} diff --git a/tests/io.sarl.lang.tests/src/test/java/io/sarl/lang/tests/bugs/to00999/Bug852.java b/tests/io.sarl.lang.tests/src/test/java/io/sarl/lang/tests/bugs/to00999/Bug852.java index 8c4bbf9e19..0741b631e1 100644 --- a/tests/io.sarl.lang.tests/src/test/java/io/sarl/lang/tests/bugs/to00999/Bug852.java +++ b/tests/io.sarl.lang.tests/src/test/java/io/sarl/lang/tests/bugs/to00999/Bug852.java @@ -66,7 +66,7 @@ public class Bug852 extends AbstractSarlTest { "public class SomeAgent extends Agent {", " @Pure", " protected void mytest(final Integer value) {", - " if ((value == null ? (null == null) : (null != null && value.doubleValue() == null.doubleValue()))) {", + " if ((value == null ? (null == null) : (null != null && value.intValue() == null.doubleValue()))) {", " }", " }", " ", @@ -117,7 +117,7 @@ public class Bug852 extends AbstractSarlTest { "public class SomeAgent extends Agent {", " @Pure", " protected void mytest(final Integer value) {", - " if ((value != null ? (value.longValue() == 2.0l) : false)) {", + " if ((value != null && (value.intValue() == 2.0l))) {", " }", " }", " ", @@ -168,7 +168,7 @@ public class Bug852 extends AbstractSarlTest { "public class SomeAgent extends Agent {", " @Pure", " protected void mytest(final Integer value, final Integer value2) {", - " if ((value == null ? (value2 == null) : (value2 != null && value.doubleValue() == value2.doubleValue()))) {", + " if ((value == null ? (value2 == null) : (value2 != null && value.intValue() == value2.doubleValue()))) {", " }", " }", " ", @@ -219,7 +219,7 @@ public class Bug852 extends AbstractSarlTest { "public class SomeAgent extends Agent {", " @Pure", " protected void mytest(final Integer value, final Integer value2) {", - " if ((value.doubleValue() <= value2.doubleValue())) {", + " if ((value.intValue() <= value2.doubleValue())) {", " }", " }", " ", @@ -320,7 +320,7 @@ public class Bug852 extends AbstractSarlTest { "public class SomeAgent extends Agent {", " @Pure", " protected long mytest(final Integer value, final long value2) {", - " return (value.longValue() + value2);", + " return (value.intValue() + value2);", " }", " ", " @SyntheticMember", @@ -370,7 +370,7 @@ public class Bug852 extends AbstractSarlTest { "public class SomeAgent extends Agent {", " @Pure", " protected double mytest(final Integer value, final Number value2) {", - " return (value.doubleValue() + value2.doubleValue());", + " return (value.intValue() + value2.doubleValue());", " }", " ", " @SyntheticMember", @@ -420,7 +420,7 @@ public class Bug852 extends AbstractSarlTest { "public class SomeAgent extends Agent {", " @Pure", " protected float mytest(final Byte value) {", - " return (5.0f + value.floatValue());", + " return (5.0f + value.byteValue());", " }", " ", " @SyntheticMember", diff --git a/tests/io.sarl.lang.tests/src/test/java/io/sarl/lang/tests/general/compilation/general/BreakKeywordTest.java b/tests/io.sarl.lang.tests/src/test/java/io/sarl/lang/tests/general/compilation/general/BreakKeywordTest.java index 6256a79271..b82fabdf75 100644 --- a/tests/io.sarl.lang.tests/src/test/java/io/sarl/lang/tests/general/compilation/general/BreakKeywordTest.java +++ b/tests/io.sarl.lang.tests/src/test/java/io/sarl/lang/tests/general/compilation/general/BreakKeywordTest.java @@ -256,7 +256,7 @@ public void insideForWithBranch() throws Exception { " protected void fct(final int a) {", " IntegerRange _upTo = new IntegerRange(0, a);", " for (final Integer b : _upTo) {", - " if ((b != null ? (b.intValue() == 5) : false)) {", + " if ((b != null && (b.intValue() == 5))) {", " break;", " }", " }", diff --git a/tests/io.sarl.lang.tests/src/test/java/io/sarl/lang/tests/general/compilation/general/ContinueKeywordTest.java b/tests/io.sarl.lang.tests/src/test/java/io/sarl/lang/tests/general/compilation/general/ContinueKeywordTest.java index eb72a6a1f8..bf83edc070 100644 --- a/tests/io.sarl.lang.tests/src/test/java/io/sarl/lang/tests/general/compilation/general/ContinueKeywordTest.java +++ b/tests/io.sarl.lang.tests/src/test/java/io/sarl/lang/tests/general/compilation/general/ContinueKeywordTest.java @@ -256,7 +256,7 @@ public void insideForWithBranch() throws Exception { " protected void fct(final int a) {", " IntegerRange _upTo = new IntegerRange(0, a);", " for (final Integer b : _upTo) {", - " if ((b != null ? (b.intValue() == 5) : false)) {", + " if ((b != null && (b.intValue() == 5))) {", " continue;", " }", " }", diff --git a/tests/io.sarl.tests.api/src/main/java/io/sarl/tests/api/AbstractMassiveCompilationTest.java b/tests/io.sarl.tests.api/src/main/java/io/sarl/tests/api/AbstractMassiveCompilationTest.java new file mode 100644 index 0000000000..527abf6148 --- /dev/null +++ b/tests/io.sarl.tests.api/src/main/java/io/sarl/tests/api/AbstractMassiveCompilationTest.java @@ -0,0 +1,130 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2018 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.tests.api; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.reflect.Method; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TreeMap; + +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.xtext.common.types.TypesPackage; +import org.eclipse.xtext.xbase.validation.IssueCodes; +import org.junit.Test; + +import io.sarl.lang.sarl.SarlScript; + +/** Abstract implementation of tests that needs a massive number of compilations. + * + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @since 0.8.6 + */ +public abstract class AbstractMassiveCompilationTest extends AbstractSarlTest { + + @Nullable + private Map differedTests; + + @Nullable + private String currentMethod; + + @Nullable + private ResourceSet resourceSet = null; + + /** Assert that a single type is correctly generated. + * Correctly means that the expected Java code is generated and equals to the expected code. + * + * @param sarlExpression the SARL expression to compile, without the package definition. + * @param javaExpression the expected Java expression, without the package definition. + * @throws Exception in case of error. + */ + protected void diffSingleTypeCompileTo(String sarlExpression, String javaExpression) throws Exception { + final String packageName = "io.sarl.lang.core.tests." + this.currentMethod; //$NON-NLS-1$ + final String inputCode = "package " + packageName + "\n" + sarlExpression; //$NON-NLS-1$ //$NON-NLS-2$ + final SarlScript script; + if (this.resourceSet == null) { + script = getParseHelper().parse(inputCode); + this.resourceSet = script.eResource().getResourceSet(); + } else { + script = getParseHelper().parse(inputCode, this.resourceSet); + } + final String qualifiedName = packageName + "." + script.getXtendTypes().get(0).getName(); //$NON-NLS-1$ + this.differedTests.put(qualifiedName, "package " + packageName + ";\n\n" + javaExpression); //$NON-NLS-1$ //$NON-NLS-2$ + } + + /** Assert that a single type is not correctly generated due to invalid implementation of the Xbase API. + * In future version of this class, this function may disappear. + * + * @param sarlExpression the SARL expression to compile, without the package definition. + * @throws Exception in case of error. + */ + protected void diffSingleTypeCompileTo_unexpectedCastError(String sarlExpression) throws Exception { + final String packageName = "io.sarl.lang.core.tests." + this.currentMethod; //$NON-NLS-1$ + final String inputCode = "package " + packageName + "\n" + sarlExpression; //$NON-NLS-1$ //$NON-NLS-2$ + validate(file(inputCode)).assertError( + TypesPackage.eINSTANCE.getJvmParameterizedTypeReference(), + IssueCodes.INVALID_CAST); + } + + /** Run the differed tests. + * + * @throws Exception in case of error. + */ + @Test + public void testAll() throws Exception { + this.differedTests = new TreeMap<>(); + for (final Method meth : getClass().getDeclaredMethods()) { + if (meth.isAnnotationPresent(DifferedTest.class)) { + this.currentMethod = meth.getName(); + meth.invoke(this); + } + } + assertNotNull(this.resourceSet); + getCompileHelper().compile(this.resourceSet, it -> { + for (final Entry entry : this.differedTests.entrySet()) { + final String actual = it.getGeneratedCode(entry.getKey()); + assertEquals(entry.getKey(), entry.getValue(), actual); + } + }); + } + + /** Annotation for marking the tests as differed. + * + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @since 0.8.6 + */ + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.METHOD}) + public static @interface DifferedTest { + // + } + +}