deprecate old projects & reduce CI workload
This commit is contained in:
184
projects/_deprecated/asciilib/test/assets/laptop.srf
Normal file
184
projects/_deprecated/asciilib/test/assets/laptop.srf
Normal file
@@ -0,0 +1,184 @@
|
||||
COLORS
|
||||
! 128 128 255
|
||||
" 255 255 255
|
||||
# 98 49 0
|
||||
$ 159 80 0
|
||||
% 41 41 41
|
||||
& 128 128 128
|
||||
' 106 106 106
|
||||
( 0 0 0
|
||||
INFO CODES
|
||||
! .
|
||||
" POINT_screen
|
||||
SIZE
|
||||
68 33
|
||||
CHARACTERS
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
test text on laptop
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
BACKGROUND COLORS
|
||||
!!!!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!!
|
||||
!!!!%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%!!!!
|
||||
!!!!%&''''''''''''''''''''''''''''''''''''''''''''''''''''''''&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
|
||||
!!!!%&''''''''''''''''''''''''''''''''''''''''''''''''''''''''&%!!!!
|
||||
!!!!%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%!!!!
|
||||
!!!!%''''''''''''''''''''''''''''''''''''''''''''''''''''''''''%!!!!
|
||||
!!!%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%!!!
|
||||
!!!%&&''''''''''''''''''''''''''''''''''''''''''''''''''''''''&&%!!!
|
||||
!!%&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&%!!
|
||||
!!%&&''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&&%!!
|
||||
!%&&'&&&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&%!
|
||||
!%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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
OPACITY
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00001111111111111111111111111111111111111111111111111111111111110000
|
||||
00011111111111111111111111111111111111111111111111111111111111111000
|
||||
00011111111111111111111111111111111111111111111111111111111111111000
|
||||
00111111111111111111111111111111111111111111111111111111111111111100
|
||||
00111111111111111111111111111111111111111111111111111111111111111100
|
||||
01111111111111111111111111111111111111111111111111111111111111111110
|
||||
01111111111111111111111111111111111111111111111111111111111111111110
|
||||
11111111111111111111111111111111111111111111111111111111111111111111
|
||||
11111111111111111111111111111111111111111111111111111111111111111111
|
||||
SPECIAL INFO
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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lib utest
|
||||
-cp src
|
||||
--main Main
|
||||
--interp
|
20
projects/_deprecated/asciilib/test/src/Main.hx
Normal file
20
projects/_deprecated/asciilib/test/src/Main.hx
Normal file
@@ -0,0 +1,20 @@
|
||||
package;
|
||||
|
||||
import utest.Runner;
|
||||
import utest.ui.Report;
|
||||
import asciilib.GameLogic;
|
||||
import asciilib.Game;
|
||||
import asciilib.backends.test.*;
|
||||
|
||||
class Main {
|
||||
public static function newGame(logic:GameLogic) {
|
||||
return new Game("Test game", 100, 40, 8, 12, logic, new TestAssetsBackend(), new TestGraphicsBackend());
|
||||
}
|
||||
|
||||
static function main() {
|
||||
var runner = new Runner();
|
||||
runner.addCases(cases);
|
||||
Report.create(runner);
|
||||
runner.run();
|
||||
}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
package cases;
|
||||
|
||||
import utest.Test;
|
||||
import utest.Assert;
|
||||
import asciilib.GameLogic;
|
||||
import asciilib.Game;
|
||||
import asciilib.Graphics;
|
||||
import asciilib.Colors;
|
||||
import asciilib.Assets;
|
||||
import asciilib.backends.test.TestGraphicsBackend;
|
||||
|
||||
class DrawOnlyWhenModifiedGameLogic implements GameLogic {
|
||||
var firstDraw = true;
|
||||
|
||||
public function new() {}
|
||||
|
||||
public function initialize(assets:Assets) {}
|
||||
|
||||
public function update(game:Game, deltaSeconds:Float):Void {}
|
||||
|
||||
public function draw(graphics:Void->Graphics, assets:Assets):Void {
|
||||
if (firstDraw) {
|
||||
graphics().setLetter(0, 0, {char: "@", color: Colors.Red});
|
||||
firstDraw = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DrawOnlyWhenModifiedTestCase extends Test {
|
||||
function testDrawOnlyWhenModified() {
|
||||
var game = Main.newGame(new DrawOnlyWhenModifiedGameLogic());
|
||||
var graphicsBackend:TestGraphicsBackend = cast game.graphicsBackend;
|
||||
game.draw();
|
||||
Assert.equals("@", game.graphics.getLetter(0, 0).char);
|
||||
Assert.equals(1, graphicsBackend.drawCalled);
|
||||
game.draw();
|
||||
Assert.equals(1, graphicsBackend.drawCalled);
|
||||
}
|
||||
}
|
@@ -0,0 +1,42 @@
|
||||
package cases;
|
||||
|
||||
import utest.Test;
|
||||
import utest.Assert;
|
||||
import asciilib.GameLogic;
|
||||
import asciilib.Game;
|
||||
import asciilib.Graphics;
|
||||
import asciilib.Colors;
|
||||
import asciilib.Assets;
|
||||
import asciilib.Surface;
|
||||
|
||||
class LoadSurfaceGameLogic implements GameLogic {
|
||||
public function new() {}
|
||||
|
||||
public function initialize(assets:Assets) {
|
||||
assets.loadSurface("laptop", "assets/laptop.srf");
|
||||
}
|
||||
|
||||
public function update(game:Game, deltaSeconds:Float):Void {}
|
||||
|
||||
public function draw(graphics:Void->Graphics, assets:Assets):Void {}
|
||||
}
|
||||
|
||||
class LoadSurfaceTestCase extends Test {
|
||||
function testLoadSurface() {
|
||||
var game = Main.newGame(new LoadSurfaceGameLogic());
|
||||
var laptop = game.assets.getSurface("laptop");
|
||||
|
||||
var cornerColor = laptop.getBackgroundColor(0, 0);
|
||||
Assert.equals(128, cornerColor.r);
|
||||
Assert.equals(128, cornerColor.g);
|
||||
Assert.equals(255, cornerColor.b);
|
||||
Assert.isFalse(laptop.isCellOpaque(0, 0));
|
||||
var topColor = laptop.getBackgroundColor(6, 0);
|
||||
Assert.equals(41, topColor.r);
|
||||
Assert.isTrue(laptop.isCellOpaque(6, 0));
|
||||
Assert.equals(".", laptop.getSpecialInfo(0, 0));
|
||||
Assert.equals("POINT_screen", laptop.getSpecialInfo(8, 4));
|
||||
Assert.equals("t", laptop.getLetter(17, 6).char);
|
||||
Assert.equals(" ", laptop.getLetter(18, 6).char);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user