Skip to content

Commit

Permalink
Add a unit test for HaxeFlixel#2107
Browse files Browse the repository at this point in the history
  • Loading branch information
Gama11 authored and jgranick committed Jan 31, 2018
1 parent 52e5e94 commit b98361f
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

- `FlxDebugger` console: fixed enum completion on non-Flash targets ([404c16b3](https://github.com/HaxeFlixel/flixel/commit/404c16b3))
- `FlxMouseEventManager`: fixed mouseOver being fired before mouseOut ([#2103](https://github.com/HaxeFlixel/flixel/issues/2103))
- `FlxAssetPaths`: fixed `filterExtensions` for files with multiple dots ([#2107](https://github.com/HaxeFlixel/flixel/issues/2107))

4.3.0 (July 22, 2017)
------------------------------
Expand Down
2 changes: 1 addition & 1 deletion flixel/system/macros/FlxAssetPaths.hx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class FlxAssetPaths
if (filterExtensions != null)
{
var extension:String = name.split(".").last(); // get the last string with a dot before it
if (filterExtensions.indexOf(extension) == -1)
if (!filterExtensions.contains(extension))
continue;
}

Expand Down
Empty file.
16 changes: 0 additions & 16 deletions tests/unit/src/flixel/system/FlxAssetsTest.hx

This file was deleted.

26 changes: 26 additions & 0 deletions tests/unit/src/flixel/system/macros/FlxAssetPathsTest.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package flixel.system.macros;

import massive.munit.Assert;

class FlxAssetPathsTest extends FlxTest
{
@Test
function testIgnoreInvisibleFiles()
{
var files:Int = Type.getClassFields(InvisibleFile).length;
Assert.areEqual(0, files);
}

@Test // #2107
function testExtensionFilterWithMultiDotFile()
{
var files:Int = Type.getClassFields(ExtensionFilterWithMultiDotFile).length;
Assert.areEqual(1, files);
}
}

@:build(flixel.system.FlxAssets.buildFileReferences("assets/FlxAssetPaths/invisibleFile"))
class InvisibleFile {}

@:build(flixel.system.FlxAssets.buildFileReferences("assets/FlxAssetPaths/fileWithMultipleDots", false, ["txt"]))
class ExtensionFilterWithMultiDotFile {}

0 comments on commit b98361f

Please sign in to comment.