Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHaxe committed Mar 11, 2024
1 parent 4da7665 commit 6687b41
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 43 deletions.
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.formatOnPaste": true,
"xml.downloadExternalResources.enabled": true
"editor.formatOnPaste": true
}
3 changes: 0 additions & 3 deletions src/Main.hx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import haxe.Timer;
import haxe.ui.Toolkit;
import flixel.FlxGame;
import game.PlayState;
import openfl.display.DisplayObject;
import openfl.display.DisplayObjectContainer;
import openfl.display.Sprite;

class Main extends Sprite {
Expand Down
62 changes: 24 additions & 38 deletions tests/data/FieldDataTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,31 @@ class FieldDataTest implements ITest {
Assert.isTrue(field.isUnchanged());
}

public function testClickOnSingle() {
public function testClickOnSingleTwoColors() {
var field = new TestFieldData();
field.init(14, 7, ThreeColors, 12345);
field.init(15, 11, TwoColors, 12345);
field.makeBackup();
field.clicked(0, 3);
Assert.isFalse(field.hasWon());
Assert.isFalse(field.isGameOver());
Assert.isTrue(field.isUnchanged());
}

public function testClickOnSingleThreeColors() {
var field = new TestFieldData();
field.init(15, 11, ThreeColors, 12345);
field.makeBackup();
field.clicked(2, 0);
field.clicked(0, 2);
Assert.isFalse(field.hasWon());
Assert.isFalse(field.isGameOver());
Assert.isTrue(field.isUnchanged());
}

public function testClickOnSingleFourColors() {
var field = new TestFieldData();
field.init(15, 11, FourColors, 12345);
field.makeBackup();
field.clicked(0, 3);
Assert.isFalse(field.hasWon());
Assert.isFalse(field.isGameOver());
Assert.isTrue(field.isUnchanged());
Expand Down Expand Up @@ -88,41 +108,6 @@ class FieldDataTest implements ITest {
Assert.isFalse(field.hasWon());
field.clicked(0, 10);

// field.clicked(7, 1);
// Assert.isFalse(field.hasWon());
// field.clicked(0, 3);
// Assert.isFalse(field.hasWon());
// field.clicked(0, 5);
// Assert.isFalse(field.hasWon());
// field.clicked(12, 5);
// Assert.isFalse(field.hasWon());
// field.clicked(10, 1);
// Assert.isFalse(field.hasWon());
// field.clicked(13, 3);
// Assert.isFalse(field.hasWon());
// field.clicked(10, 4);
// Assert.isFalse(field.hasWon());
// field.clicked(7, 2);
// Assert.isFalse(field.hasWon());
// field.clicked(0, 6);
// Assert.isFalse(field.hasWon());
// field.clicked(0, 6);
// Assert.isFalse(field.hasWon());
// field.clicked(2, 3);
// Assert.isFalse(field.hasWon());
// field.clicked(5, 5);
// Assert.isFalse(field.hasWon());
// field.clicked(2, 4);
// Assert.isFalse(field.hasWon());
// field.clicked(0, 6);
// Assert.isFalse(field.hasWon());
// field.clicked(0, 6);
// Assert.isFalse(field.hasWon());
// field.clicked(7, 6);
// Assert.isFalse(field.hasWon());
// field.clicked(0, 6);
// Assert.isFalse(field.hasWon());
// field.clicked(0, 6);
Assert.isTrue(field.hasWon());
}

Expand Down Expand Up @@ -165,6 +150,7 @@ class FieldDataTest implements ITest {
field.clicked(0, 6);
Assert.isFalse(field.isGameOver());
field.clicked(0, 6);

Assert.isTrue(field.isGameOver());
}
}
Expand Down
1 change: 1 addition & 0 deletions uitests/UiTestMain.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class UiTestMain {
// lime test html5
var driver = new AppDriver("localhost", 9999, null);
#end

#if linux_ui
// lime build linux
new AppDriver("localhost", 9999, new AppRestarter("./hxSame", [], "export/linux/bin"));
Expand Down

0 comments on commit 6687b41

Please sign in to comment.