This is an automated email from the ASF dual-hosted git repository. wave pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/flex-site.git
commit 65d10fc92ce23b97957c8e5fd382e6e283e066c7 Author: Dave Fisher <[email protected]> AuthorDate: Mon Jun 14 09:09:34 2021 -0700 fix charactoer entities in fenced code --- content/flexunit/tutorial/flexunit/Unit-10.md | 6 +++--- content/flexunit/tutorial/flexunit/Unit-13.md | 2 +- content/flexunit/tutorial/flexunit/Unit-15.md | 14 +++++++------- content/flexunit/tutorial/flexunit/Unit-16.md | 14 +++++++------- content/flexunit/tutorial/flexunit/Unit-4.md | 4 ++-- content/flexunit/tutorial/flexunit/Unit-5.md | 17 ++++++----------- content/flexunit/tutorial/flexunit/Unit-8.md | 2 +- content/flexunit/tutorial/flexunit/Unit-9.md | 2 +- 8 files changed, 28 insertions(+), 33 deletions(-) diff --git a/content/flexunit/tutorial/flexunit/Unit-10.md b/content/flexunit/tutorial/flexunit/Unit-10.md index 0ba197b..ede4582 100644 --- a/content/flexunit/tutorial/flexunit/Unit-10.md +++ b/content/flexunit/tutorial/flexunit/Unit-10.md @@ -156,7 +156,7 @@ public function Circle( origin:Point, radius:Number ) <p>Comment out the range check for radius.</p> ``` -// if( ( radius <= 0 || isNaN( radius ) ) { +// if( ( radius <= 0 || isNaN( radius ) ) { // throw new RangeError( "Radius must be a positive Number" ); // } ``` @@ -176,7 +176,7 @@ if( origin == null ) { ``` public function Circle( origin:Point, radius:Number ) { - // if( ( radius <= 0 || isNaN( radius ) ) { + // if( ( radius <= 0 || isNaN( radius ) ) { // throw new RangeError( "Radius must be a positive Number" ); // } if( origin == null ) { @@ -572,7 +572,7 @@ assertTrue( circle.equals( mockCircle ) ); <p>Uncomment the following section:</p> ``` -// if ( ( radius <= 0 ) || isNaN( radius ) ) { +// if ( ( radius <= 0 ) || isNaN( radius ) ) { // throw new RangeError("Radius must be a positive Number"); // } ``` diff --git a/content/flexunit/tutorial/flexunit/Unit-13.md b/content/flexunit/tutorial/flexunit/Unit-13.md index f0c564d..6335361 100644 --- a/content/flexunit/tutorial/flexunit/Unit-13.md +++ b/content/flexunit/tutorial/flexunit/Unit-13.md @@ -107,7 +107,7 @@ public function setUp():void { } [After] public function tearDown():void { - if( timer && timer.running ) { + if( timer && timer.running ) { timer.stop(); } timer = null; diff --git a/content/flexunit/tutorial/flexunit/Unit-15.md b/content/flexunit/tutorial/flexunit/Unit-15.md index 3776e6a..aa17d9e 100644 --- a/content/flexunit/tutorial/flexunit/Unit-15.md +++ b/content/flexunit/tutorial/flexunit/Unit-15.md @@ -165,7 +165,7 @@ override public function updateDisplayList( contentWidth:Number, contentHeight:N super.updateDisplayList( contentWidth, contentHeight ); var circle:Circle = new Circle( new Point( contentWidth/2, contentHeight/2 ), getLayoutRadius( contentWidth, contentHeight ) ); - for ( i = 0; i < target.numElements; i++ ) { + for ( i = 0; i < target.numElements; i++ ) { element = target.getElementAt(i); elementLayoutPoint = circle.getPointOnCircle( elementAngleInRadians ); ... @@ -224,7 +224,7 @@ public function set circle(value:Circle):void { ``` super.updateDisplayList( contentWidth, contentHeight ); if(circle) { - for ( i = 0; i < target.numElements; i++ ) { + for ( i = 0; i < target.numElements; i++ ) { ... } } @@ -275,9 +275,9 @@ public function distanceFrom( circle:Circle ):Number { ``` public function equals( circle:Circle ):Boolean { var equal:Boolean = false; - if ( ( circle ) && ( this.radius == circle.radius ) && ( this.origin ) && + if ( ( circle ) && ( this.radius == circle.radius ) && ( this.origin ) && ( circle.origin ) ) { - if ( ( this.origin.x == circle.origin.x ) && ( this.origin.y == circle.origin.y ) ) { + if ( ( this.origin.x == circle.origin.x ) && ( this.origin.y == circle.origin.y ) ) { equal = true; } } @@ -291,7 +291,7 @@ public function equals( circle:Circle ):Boolean { <p>In the <code>equals()</code> method, replace the line of the second if statement, which checks the equality of this and the comparison circle's origin's x and y values, with a line that checks that <code>this.distanceFrom( circle )</code> is equal to <code>0</code>.</p> ``` -if ( ( this.origin.x == circle.origin.x ) && +if ( ( this.origin.x == circle.origin.x ) && ( this.origin.y == circle.origin.y ) ) { equal = true; } @@ -310,8 +310,8 @@ if ( this.distanceFrom( circle ) == 0 ) { ``` public function equals( circle:Circle ):Boolean { var equal:Boolean = false; - if ( ( circle ) && ( this.radius == circle.radius ) && - ( this.origin ) && ( circle.origin ) ) { + if ( ( circle ) && ( this.radius == circle.radius ) && + ( this.origin ) && ( circle.origin ) ) { if ( this.distanceFrom( circle ) == 0 ) { equal = true; } diff --git a/content/flexunit/tutorial/flexunit/Unit-16.md b/content/flexunit/tutorial/flexunit/Unit-16.md index 713205c..f8378e5 100644 --- a/content/flexunit/tutorial/flexunit/Unit-16.md +++ b/content/flexunit/tutorial/flexunit/Unit-16.md @@ -158,7 +158,7 @@ private function onCreationComplete():void { </ul> ``` -<project name=<i>"project_name"</i> basedir=<i>"project_base"</i> default=<i>"default_target"</i> > +<project name=<i>"project_name"</i> basedir=<i>"project_base"</i> default=<i>"default_target"</i> > ``` <h3>Property tag</h3> @@ -170,7 +170,7 @@ private function onCreationComplete():void { </ul> ``` -<property name=<i>"property_name"</i> location=<i>"property_location"</i> /> +<property name=<i>"property_name"</i> location=<i>"property_location"</i> /> ``` <h3>Taskdef tag</h3> @@ -183,7 +183,7 @@ private function onCreationComplete():void { </ul> ``` -<taskdef resource=<i>"task_location_within_jar"</i> classpath=<i>"task_jar_location"</i> /> +<taskdef resource=<i>"task_location_within_jar"</i> classpath=<i>"task_jar_location"</i> /> ``` <h3>Target tag</h3> @@ -198,7 +198,7 @@ private function onCreationComplete():void { </ul> ``` -<target name=<i>"target_name"</i> depends=<i>"target_dependencies"</i>> +<target name=<i>"target_name"</i> depends=<i>"target_dependencies"</i>> ``` <h3>Task</h3> @@ -213,7 +213,7 @@ private function onCreationComplete():void { </ul> ``` -<taskname id=<i>"task_id"</i> attribute1=<i>"..."</i> attribute2=<i>"..."</i> ... /> +<taskname id=<i>"task_id"</i> attribute1=<i>"..."</i> attribute2=<i>"..."</i> ... /> ``` <ul> @@ -301,8 +301,8 @@ private function onCreationComplete():void { <p>First, navigate to your Flex SDK. In most cases, your Flex SDK should be located at root/Program Files/Adobe/Adobe Flash Builder 4/sdks.</p> ``` -<property name="FLEX_HOME" - location="rootpath:/Program Files/Adobe/Adobe Flash Builder 4/sdks/4.1.0/" /> +<property name="FLEX_HOME" + location="rootpath:/Program Files/Adobe/Adobe Flash Builder 4/sdks/4.1.0/" /> ``` <p>It is highly recommended you use Flex 4.1 SDK. Keep every directory in this walkthrough relative to the FLEX_HOME directory, this way the build file is guaranteed to reference these correctly.</p> diff --git a/content/flexunit/tutorial/flexunit/Unit-4.md b/content/flexunit/tutorial/flexunit/Unit-4.md index 58eebba..4dc11cd 100644 --- a/content/flexunit/tutorial/flexunit/Unit-4.md +++ b/content/flexunit/tutorial/flexunit/Unit-4.md @@ -355,7 +355,7 @@ public function testAddition():void { <p>FlexUnit 4.x catches the <code>AssertionError</code> that is thrown when this test fails, and the following result is displayed within the FlexUnit Results window in Flash Builder:</p> ``` -"expected: <1000> but was: <8>" +"expected: <1000> but was: <8>" ``` @@ -375,7 +375,7 @@ public function testAddition():void { <p>For example, both of these assertions would fail given the opportunity. However, as soon as FlexUnit catches the first failed assertion it stops the test. The second assert will never be called. The error message would read:</p> ``` -"expected: <1000> but was: <8>" +"expected: <1000> but was: <8>" ``` diff --git a/content/flexunit/tutorial/flexunit/Unit-5.md b/content/flexunit/tutorial/flexunit/Unit-5.md index 9f81d6e..74ef8be 100644 --- a/content/flexunit/tutorial/flexunit/Unit-5.md +++ b/content/flexunit/tutorial/flexunit/Unit-5.md @@ -133,10 +133,8 @@ public function ignoreTest() :void <li> <p>Run the FlexUnit4Training.mxml file again.</p> <p>If FlexUnit4Training.mxml ran successfully you should see the following output in your browser window. Note that there is one less test than previously results:</p> - <img alt='TwoTestFailures' id='shift' src='../images/unit5/image2.png' /> <p class='caption' id='shift'>Figure 2: Two test failures</p> - <h3><br />Using Ignore metadata</h3> </li> <li> @@ -160,7 +158,6 @@ public function shouldGetBottomPointOnCircle():void { <li> <p>Run the FlexUnit4Training.mxml file again.</p> <p>If FlexUnit4Training.mxml ran successfully you should see the following output in your browser window:</p> - <img alt='TwoTestsOneIgnore' id='shift' src='../images/unit5/image3.png' /> <p class='caption' id='shift'>Figure 3: Two test failures and one has been ignored</p> </li> @@ -181,7 +178,6 @@ public function shouldThrowRangeError():void { <li> <p>Run the FlexUnit4Training.mxml file again.</p> <p>If FlexUnit4Training.mxml ran successfully you should see the following output in your browser window:</p> - <img alt='FourIgnores' id='shift' src='../images/unit5/image4.png' /> <p class='caption' id='shift'>Figure 4: Four tests have been ignored</p> </li> @@ -226,13 +222,13 @@ public function shouldGetPointsOnCircle():void <p>Additionally, the simplistic nature of the assertions you have learned so far, also means they provide simplistic error messages. Take the case of this slightly more complicated assertion that determines if a number is between two other numbers:</p> ``` -assertTrue( num1 > num2 && num1 < num3 ); +assertTrue( num1 > num2 && num1 < num3 ); ``` <p>If this test fails, it would yield the basic and uninformative failure message:</p> ``` -"Expected <true> but was <false>." +"Expected <true> but was <false>." ``` <p>This information, while true, is not all that useful for instant problem identification. This lack of information forces the developer back to the original test to understand what was being tested and helps defeat one of the key advantages of having tests.</p> @@ -251,7 +247,7 @@ public function assertThat( value, matcher ); <p>Referring back to the example from above, if you wished to know if num1 was between num2 and num3 using standard assert syntax, you would write:</p> ``` -assertTrue( num2 < num1 && num1 < num3); +assertTrue( num2 < num1 && num1 < num3); ``` <p>Using Hamcrest, this same assertion would read:</p> @@ -264,13 +260,13 @@ assertThat( num1, is( between( num2, num3 ) ) ); <p>Second, if the <code>assertThat()</code> statement above fails it would yield the following result:</p> ``` -"Expected a number between <num2> and <num3> but was <num1>." +"Expected a number between <num2> and <num3> but was <num1>." ``` <p>which is many, many times more useful than the <code>assertTrue()</code> statement's failure message in this same situation:</p> ``` -"Expected <true> but was <false>." +"Expected <true> but was <false>." ``` <p>This particular assertion uses the <code>is()</code> and <code>between()</code> matchers to create a more readable assertion. These are just two of the many types of matchers offered by Hamcrest. Further, as each matcher is simply a class that implements a specific interface, you are encouraged to create your own matchers to make even the most difficult matching clear inside of your test cases.</p> @@ -419,7 +415,6 @@ public function shouldGetLeftPointOnCircle():void { </li> <li> <p>Run the FlexUnit4Training.mxml file. If the tests ran successfully, you should see the following output.</p> - <img alt='PassedOneIgnore' id='shift' src='../images/unit5/image6.png' /> <p class='caption' id='shift'>Figure 1: FlexUnit tests passed, one ignored</p> </li> @@ -548,7 +543,7 @@ override public function matchesSafely(item:Object):Boolean { ``` override public function matchesSafely(item:Object):Boolean { var distance:Number = Point.distance( item as Point, point ); - return( Math.abs( distance ) - tolerance < 0 ); + return( Math.abs( distance ) - tolerance < 0 ); } ``` diff --git a/content/flexunit/tutorial/flexunit/Unit-8.md b/content/flexunit/tutorial/flexunit/Unit-8.md index 0a6ce07..995b268 100644 --- a/content/flexunit/tutorial/flexunit/Unit-8.md +++ b/content/flexunit/tutorial/flexunit/Unit-8.md @@ -39,7 +39,7 @@ Title: Unit 8 - FlexUnit Theories ``` public function absoluteValue( value:int ):int { - if ( value < 0 ) { + if ( value < 0 ) { return value * -1; } else { return value; diff --git a/content/flexunit/tutorial/flexunit/Unit-9.md b/content/flexunit/tutorial/flexunit/Unit-9.md index 40cecd0..51f5cf4 100644 --- a/content/flexunit/tutorial/flexunit/Unit-9.md +++ b/content/flexunit/tutorial/flexunit/Unit-9.md @@ -58,7 +58,7 @@ public function result( data:Object ):void { var list:XMLList = data.result..node; var node:XML; - for ( var i:int = 0; i < list.length(); i++ ) { + for ( var i:int = 0; i < list.length(); i++ ) { node = list[ i ][ 0 ]; ar.push( Number( node.text() ) ); }
