Skip to content

Commit

Permalink
tests: Haxe 3 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Nov 15, 2023
1 parent 0a352c7 commit 9dfd456
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion tests/src/tests/animation/JugglerTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.hamcrest.Matchers.closeTo;

class JugglerTest extends Test
{
private final E:Float = 0.0001;
@:final private var E:Float = 0.0001;

public function testModificationWithinCallback():Void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/animation/TweenTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import utest.Test;

class TweenTest extends Test
{
private final E:Float = 0.0001;
@:final private var E:Float = 0.0001;

public function testBasicTween():Void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/display/ButtonTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import tests.utils.MockTexture;

class ButtonTest extends StarlingTest
{
private static final E:Float = 0.0001;
@:final private static var E:Float = 0.0001;


public function testWidthAndHeight():Void
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/display/DisplayObjectContainerTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import utest.Test;

class DisplayObjectContainerTest extends Test
{
private static final E:Float = 0.0001;
@:final private static var E:Float = 0.0001;

private var _added:Int;
private var _addedToStage:Int;
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/display/DisplayObjectTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import utest.Test;

class DisplayObjectTest extends Test
{
private static final E:Float = 0.0001;
@:final private static var E:Float = 0.0001;


public function testBase():Void
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/display/ImageTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import utest.Test;

class ImageTest extends Test
{
private static final E:Float = 0.00001;
@:final private static var E:Float = 0.00001;


public function testBindScale9GridToTexture():Void
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/display/MeshTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class MeshTest extends Test
mesh.setVertexAlpha(1, 0.5);
mesh.setVertexAlpha(2, 0.8);

final E:Float = 0.02;
var E:Float = 0.02;
Helpers.assertThat(mesh.getVertexAlpha(0), closeTo(0.2, E));
Helpers.assertThat(mesh.getVertexAlpha(1), closeTo(0.5, E));
Helpers.assertThat(mesh.getVertexAlpha(2), closeTo(0.8, E));
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/display/MovieClipTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import utest.Test;

class MovieClipTest extends Test
{
private final E:Float = 0.0001;
@:final private var E:Float = 0.0001;


public function testFrameManipulation():Void
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/display/QuadTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import utest.Test;

class QuadTest extends Test
{
private static final E:Float = 0.0001;
@:final private static var E:Float = 0.0001;


public function testQuad():Void
Expand Down
10 changes: 5 additions & 5 deletions tests/src/tests/events/EventTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import utest.Test;
class EventTest extends Test {
public function testBubbling():Void
{
final eventType:String = "test";
var eventType:String = "test";

var grandParent:Sprite = new Sprite();
var parent:Sprite = new Sprite();
Expand Down Expand Up @@ -98,7 +98,7 @@ class EventTest extends Test {

public function testStopPropagation():Void
{
final eventType:String = "test";
var eventType:String = "test";

var grandParent:Sprite = new Sprite();
var parent:Sprite = new Sprite();
Expand Down Expand Up @@ -228,7 +228,7 @@ class EventTest extends Test {

public function testBubbleWithModifiedChain():Void
{
final eventType:String = "test";
var eventType:String = "test";

var grandParent:Sprite = new Sprite();
var parent:Sprite = new Sprite();
Expand Down Expand Up @@ -265,7 +265,7 @@ class EventTest extends Test {

public function testRedispatch():Void
{
final eventType:String = "test";
var eventType:String = "test";

var grandParent:Sprite = new Sprite();
var parent:Sprite = new Sprite();
Expand Down Expand Up @@ -319,7 +319,7 @@ class EventTest extends Test {

public function testHasEventListener():Void
{
final eventType:String = "event";
var eventType:String = "event";
var dispatcher:EventDispatcher = new EventDispatcher();

function onEvent():Void {}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/geom/PolygonTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import utest.Test;

class PolygonTest extends Test
{
private static final E:Float = 0.0001;
@:final private static var E:Float = 0.0001;


public function testConstructorWithPoints():Void
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/rendering/VertexDataFormatTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import utest.Test;

class VertexDataFormatTest extends Test
{
private static final STD_FORMAT:String = "position:float2, texCoords:float2, color:bytes4";
@:final private static var STD_FORMAT:String = "position:float2, texCoords:float2, color:bytes4";

public function testFormatParsing():Void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/src/tests/rendering/VertexDataTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import utest.Test;

class VertexDataTest extends Test
{
private static final E:Float = 0.001;
private static final STD_FORMAT:String = "position:float2, texCoords:float2, color:bytes4";
@:final private static var E:Float = 0.001;
@:final private static var STD_FORMAT:String = "position:float2, texCoords:float2, color:bytes4";


public function testNumVertices():Void
Expand Down
6 changes: 3 additions & 3 deletions tests/src/tests/text/TextFieldTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import utest.Assert;

class TextFieldTest extends StarlingTest
{
private static final E:Float = 0.0001;
private static final SUPER_LARGE_TEXT_LENGTH:Float = 3200;
@:final private static var E:Float = 0.0001;
@:final private static var SUPER_LARGE_TEXT_LENGTH:Float = 3200;


public function testTextField():Void
Expand Down Expand Up @@ -80,7 +80,7 @@ class TextFieldTest extends StarlingTest
/** Creates a sample text longer than 'leastLength'. */
private function getSampleText(leastLength:Int):String
{
final sample:String = "This is a sample String. ";
var sample:String = "This is a sample String. ";
var repeat:Int = Math.ceil(leastLength / sample.length);
var parts:Vector<String> = new Vector<String>(repeat);

Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/textures/TextureAtlasTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import utest.Test;

class TextureAtlasTest extends Test
{
private final E:Float = 0.0001;
@:final private var E:Float = 0.0001;

public function testXmlParsing():Void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/textures/TextureTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import utest.Assert;

class TextureTest extends Test
{
private static final E:Float = 0.0001;
@:final private static var E:Float = 0.0001;

public function testTextureCoordinates():Void
{
Expand Down
12 changes: 6 additions & 6 deletions tests/src/tests/utils/AssetManagerTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ class AssetManagerTest extends StarlingTest

public function testTextureAsset():Void
{
final NAME:String = "test_texture";
var NAME:String = "test_texture";
var texture:MockTexture = new MockTexture();

_manager.addAsset(NAME, texture);
Expand All @@ -334,7 +334,7 @@ class AssetManagerTest extends StarlingTest

public function testTextureAtlasAsset():Void
{
final NAME:String = "test_textureAtlas";
var NAME:String = "test_textureAtlas";
var atlas:TextureAtlas = new TextureAtlas(null);

_manager.addAsset(NAME, atlas);
Expand All @@ -350,7 +350,7 @@ class AssetManagerTest extends StarlingTest

public function testSoundAsset():Void
{
final NAME:String = "test_sound";
var NAME:String = "test_sound";
var sound:Sound = new Sound();

_manager.addAsset(NAME, sound);
Expand All @@ -372,7 +372,7 @@ class AssetManagerTest extends StarlingTest

public function testXmlAsset():Void
{
final NAME:String = "test_xml";
var NAME:String = "test_xml";
var xml:Xml = Xml.parse("<test/>");

_manager.addAsset(NAME, xml);
Expand All @@ -388,7 +388,7 @@ class AssetManagerTest extends StarlingTest

public function testObjectAsset():Void
{
final NAME:String = "test_object";
var NAME:String = "test_object";
var object:Dynamic = {};

_manager.addAsset(NAME, object);
Expand All @@ -404,7 +404,7 @@ class AssetManagerTest extends StarlingTest

public function testByteArrayAsset():Void
{
final NAME:String = "test_bytearray";
var NAME:String = "test_bytearray";
var bytes:ByteArray = new ByteArray();

_manager.addAsset(NAME, bytes);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/utils/ColorTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import utest.Test;

class ColorTest extends Test
{
private static final E:Float = 0.004;
@:final private static var E:Float = 0.004;


public function testGetElement():Void
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/utils/MathUtilTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import utest.Test;

class MathUtilTest extends Test
{
private static final E:Float = 0.0001;
@:final private static var E:Float = 0.0001;


public function testNormalizeAngle():Void
Expand Down

0 comments on commit 9dfd456

Please sign in to comment.