You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2020/06/24 06:07:15 UTC
[royale-asjs] branch develop updated: Add language testing of
while-loop variants with empty loop bodies
This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 4494224 Add language testing of while-loop variants with empty loop bodies
new 5499aff Merge branch 'develop' of https://github.com/apache/royale-asjs into develop
4494224 is described below
commit 4494224b85f034f6b1cd8d26b7007d9b3cebe4cb
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Jun 24 13:10:43 2020 +1200
Add language testing of while-loop variants with empty loop bodies
---
.../src/test/royale/flexUnitTests/CoreTester.as | 1 +
.../language/LanguageTesterTestLoopVariants.as | 87 ++++++++++++++++++++++
2 files changed, 88 insertions(+)
diff --git a/frameworks/projects/Core/src/test/royale/flexUnitTests/CoreTester.as b/frameworks/projects/Core/src/test/royale/flexUnitTests/CoreTester.as
index 088a563..551890d 100644
--- a/frameworks/projects/Core/src/test/royale/flexUnitTests/CoreTester.as
+++ b/frameworks/projects/Core/src/test/royale/flexUnitTests/CoreTester.as
@@ -30,6 +30,7 @@ package flexUnitTests
public var languageTestIntUint:LanguageTesterIntUint;
public var languageTestVector:LanguageTesterTestVector;
public var languageTestClass:LanguageTesterTestClass;
+ public var languageTestLoopVariants:LanguageTesterTestLoopVariants;
//core tests
diff --git a/frameworks/projects/Core/src/test/royale/flexUnitTests/language/LanguageTesterTestLoopVariants.as b/frameworks/projects/Core/src/test/royale/flexUnitTests/language/LanguageTesterTestLoopVariants.as
new file mode 100644
index 0000000..73b4c78
--- /dev/null
+++ b/frameworks/projects/Core/src/test/royale/flexUnitTests/language/LanguageTesterTestLoopVariants.as
@@ -0,0 +1,87 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You 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 flexUnitTests.language
+{
+
+ import org.apache.royale.test.asserts.*;
+ import flexUnitTests.language.support.*;
+
+ import testshim.RoyaleUnitTestRunner;
+
+ /**
+ * @royalesuppresspublicvarwarning
+ */
+ public class LanguageTesterTestLoopVariants
+ {
+
+ public static var isJS:Boolean = COMPILE::JS;
+
+
+
+
+ [BeforeClass]
+ public static function setUpBeforeClass():void
+ {
+ }
+
+ [AfterClass]
+ public static function tearDownAfterClass():void
+ {
+ }
+
+ [Before]
+ public function setUp():void
+ {
+ }
+
+ [After]
+ public function tearDown():void
+ {
+ }
+
+
+
+
+ [Test]
+ public function testWhileLoopWithoutBody():void
+ {
+ var test:int=-1;
+ var limit:int=100;
+ //while loop with no body
+ while (++test<limit);
+
+ assertEquals(test, limit, 'unexpected result');
+ }
+
+ [Test]
+ public function testWhileLoopWithEmptyBody():void
+ {
+ var test:int=-1;
+ var limit:int=100;
+ //while loop with empty body
+ while (++test<limit){}
+
+ assertEquals(test, limit, 'unexpected result');
+
+ }
+
+
+ }
+}
+