[ascii] Test graphics backend, first unit test

This commit is contained in:
2021-04-26 18:13:52 -06:00
parent 5e16fd84f4
commit 31e918e3f2
7 changed files with 83 additions and 5 deletions

View File

@@ -0,0 +1,7 @@
package asciilib.backends.test;
import asciilib.GraphicsBackend;
import asciilib.Graphics;
@:build(kiss.Kiss.build())
class TestGraphicsBackend implements GraphicsBackend {}

View File

@@ -0,0 +1,12 @@
(defprop &mut :Int letterWidth 0)
(defprop &mut :Int letterHeight 0)
(defprop &mut :Int drawCalled 0)
(defmethod new [] 0)
(defmethod :Void initialize [:String title :Int width :Int height :Int _letterWidth :Int _letterHeight]
(set letterWidth _letterWidth)
(set letterHeight _letterHeight))
(defmethod :Void draw [:Graphics graphics]
(+= drawCalled 1))