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
commit 26b15418ae17f80e4887477500f8c5d10219e02e Author: greg-dove <[email protected]> AuthorDate: Thu Aug 8 11:55:21 2019 +1200 Porting remnants of manualtests/UnitTests to RoyaleUnit-compatible assertions --- .../royale/flexUnitTests/core/ArrayTesterTest.as | 38 +++++++++++----------- .../src/main/royale/flexUnitTests/core/MD5Test.as | 8 ++--- .../flexUnitTests/github/GithubIssues2018.as | 6 ++-- .../flexUnitTests/github/GithubIssues2019.as | 4 +-- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/core/ArrayTesterTest.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/core/ArrayTesterTest.as index d038de6..ed70a54 100644 --- a/manualtests/UnitTests/src/main/royale/flexUnitTests/core/ArrayTesterTest.as +++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/core/ArrayTesterTest.as @@ -20,7 +20,7 @@ package flexUnitTests.core { - import flexunit.framework.Assert; + import org.apache.royale.test.asserts.*; import flexUnitTests.core.support.TestVO; /** @@ -90,43 +90,43 @@ package flexUnitTests.core [Test] public function testSort():void { - Assert.assertTrue("Parked, needs more work", true); + assertTrue(true, "Parked, needs more work"); /*import testshim.RoyaleUnitTestRunner; - /!*Assert.assertEquals('unexpected starting state', + /!*assertEquals( '23,-93,-59,-55,41,-29,69,11,33,-71,83,87,27,-39,70,-50,-56,-61,17,-35,-60,-86,-78,-83,-10', - values.toString());*!/ - Assert.assertEquals('unexpected starting state', + values.toString(), 'unexpected starting state');*!/ + assertEquals( 'aB,aA,aC,aa,ab,ac,zA,ZA,zA,ZA,zA,zA,AA,AA', - field1s.toString()); + field1s.toString(), 'unexpected starting state'); field1s.sort(); - Assert.assertEquals('unexpected starting state', + assertEquals( 'AA,AA,ZA,ZA,aA,aB,aC,aa,ab,ac,zA,zA,zA,zA', - field1s.toString()); + field1s.toString(), 'unexpected starting state'); RoyaleUnitTestRunner.consoleOut('field1s ' + field1s.toString()); _sort(field1s, [Array.CASEINSENSITIVE]); - Assert.assertEquals('unexpected starting state', + assertEquals( 'aa,AA,aA,AA,ab,aB,ac,aC,ZA,ZA,zA,zA,zA,zA', - field1s.toString()); + field1s.toString(), 'unexpected starting state'); _sort(field1s, [Array.DESCENDING]); - Assert.assertEquals('unexpected starting state', + assertEquals( 'zA,zA,zA,zA,ac,ab,aa,aC,aB,aA,ZA,ZA,AA,AA', - field1s.toString()); + field1s.toString(), 'unexpected starting state'); // field1s.sort(Array.CASEINSENSITIVE); RoyaleUnitTestRunner.consoleOut('field1s ' + field1s.toString()); _sort(field1s, [Array.DESCENDING|Array.CASEINSENSITIVE]); - Assert.assertEquals('unexpected starting state', + assertEquals( 'zA,zA,zA,zA,ZA,ZA,ac,aC,ab,aB,AA,aA,aa,AA', - field1s.toString()); + field1s.toString(), 'unexpected starting state'); RoyaleUnitTestRunner.consoleOut('field1s ' + field1s.toString());*/ } @@ -135,11 +135,11 @@ package flexUnitTests.core [Test] public function testSortOn():void { - Assert.assertTrue("Parked, needs more work", true); + assertTrue(true, "Parked, needs more work"); - /* Assert.assertEquals('unexpected starting state', + /* assertEquals( 'TestVO [aB]#0 [zz],TestVO [aA]#0 [aa],TestVO [aC]#1 [zz],TestVO [aa]#1 [aa],TestVO [ab]#-1 [zz],TestVO [ac]#-1 [aa],TestVO [zA]#0 [bb],TestVO [ZA]#0 [aa],TestVO [zA]#1 [bb],TestVO [ZA]#1 [aa],TestVO [zA]#-1 [bb],TestVO [zA]#-1 [aa],TestVO [AA]#0 [aa],TestVO [AA]#0 [zz]', - items.toString()); + items.toString(), 'unexpected starting state'); import testshim.RoyaleUnitTestRunner; @@ -148,9 +148,9 @@ package flexUnitTests.core items.sortOn('field1',0); - Assert.assertEquals('unexpected sortOn result', + assertEquals( 'TestVO [AA]#0 [aa],TestVO [AA]#0 [zz],TestVO [ZA]#0 [aa],TestVO [ZA]#-1 [aa],TestVO [ZA]#1 [aa],TestVO [aA]#0 [zz],TestVO [aA]#-1 [zz],TestVO [aA]#-1 [aa],TestVO [aA]#0 [aa],TestVO [aA]#1 [aa],TestVO [aA]#1 [zz],TestVO [zA]#-1 [bb],TestVO [zA]#0 [bb],TestVO [zA]#1 [bb]', - items.toString()); + items.toString(), 'unexpected sortOn result'); diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/core/MD5Test.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/core/MD5Test.as index 0c154cf..4cc0581 100644 --- a/manualtests/UnitTests/src/main/royale/flexUnitTests/core/MD5Test.as +++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/core/MD5Test.as @@ -18,7 +18,7 @@ //////////////////////////////////////////////////////////////////////////////// package flexUnitTests.core { - import flexunit.framework.Assert; + import org.apache.royale.test.asserts.*; import org.apache.royale.utils.MD5; @@ -47,9 +47,9 @@ package flexUnitTests.core [Test] public function testHash():void { - Assert.assertEquals("Error testing foobaz", "80338e79d2ca9b9c090ebaaa2ef293c7", MD5.hash("foobaz")); - Assert.assertEquals("Error testing bazfoo", "b6a013d5e2c00f894584ad577249dbc7", MD5.hash("bazfoo")); - Assert.assertEquals("Error testing password1234", "bdc87b9c894da5168059e00ebffb9077", MD5.hash("password1234")); + assertEquals( "80338e79d2ca9b9c090ebaaa2ef293c7", MD5.hash("foobaz"), "Error testing foobaz"); + assertEquals("b6a013d5e2c00f894584ad577249dbc7", MD5.hash("bazfoo"), "Error testing bazfoo"); + assertEquals("bdc87b9c894da5168059e00ebffb9077", MD5.hash("password1234"), "Error testing password1234"); } } } diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/github/GithubIssues2018.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/github/GithubIssues2018.as index f9cb7b3..7728d55 100644 --- a/manualtests/UnitTests/src/main/royale/flexUnitTests/github/GithubIssues2018.as +++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/github/GithubIssues2018.as @@ -18,7 +18,7 @@ //////////////////////////////////////////////////////////////////////////////// package flexUnitTests.github { - import flexunit.framework.Assert; + import org.apache.royale.test.asserts.*; /** * @royalesuppresspublicvarwarning @@ -60,10 +60,10 @@ package flexUnitTests.github //int var test:* = new (Class(a.a))(-21.5); - Assert.assertEquals('unexpected coercion check', -21, test); + assertEquals(-21, test, 'unexpected coercion check'); //uint test = new (a.b as Class)(-21.5); - Assert.assertEquals('unexpected coercion check', 4294967275, test); + assertEquals(4294967275, test, 'unexpected coercion check'); } } diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/github/GithubIssues2019.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/github/GithubIssues2019.as index 8ae9640..647d93d 100644 --- a/manualtests/UnitTests/src/main/royale/flexUnitTests/github/GithubIssues2019.as +++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/github/GithubIssues2019.as @@ -18,7 +18,7 @@ //////////////////////////////////////////////////////////////////////////////// package flexUnitTests.github { - import flexunit.framework.Assert; + import org.apache.royale.test.asserts.*; /** * @royalesuppresspublicvarwarning @@ -59,7 +59,7 @@ package flexUnitTests.github public function placeholdertestIssue_999():void { //https://github.com/apache/royale-asjs/issues/# - Assert.assertTrue('replace me with a real issue', true) + assertTrue( true, 'replace me with a real issue'); } } }
