aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGene Pasquet <dev@etenil.net>2026-04-18 02:47:10 +0100
committerGene Pasquet <dev@etenil.net>2026-04-18 02:47:10 +0100
commit38eee24832fe6da4f135cae455881ab97953b23a (patch)
treecffc2bb3b45ac11d90f4a2de3e207f65862fb6fd /tests
parenta02b892e2ad1e1605ff942c63afdd618daa48be4 (diff)
Refresh docs and re-indent
Diffstat (limited to 'tests')
-rw-r--r--tests/engine-test.scm6
-rw-r--r--tests/scene-loader-test.scm16
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/engine-test.scm b/tests/engine-test.scm
index 40a02ad..ddeb308 100644
--- a/tests/engine-test.scm
+++ b/tests/engine-test.scm
@@ -139,6 +139,12 @@
(define (render-debug-scene! . args) #f))
(import downstroke-renderer)
+;; --- Animation module (mock) ---
+(module downstroke-animation *
+ (import scheme (chicken base))
+ (define (apply-animation e s d) e))
+(import downstroke-animation)
+
;; --- Engine module (real) ---
(include "engine.scm")
(import downstroke-engine)
diff --git a/tests/scene-loader-test.scm b/tests/scene-loader-test.scm
index 6e0be9c..f2ebde0 100644
--- a/tests/scene-loader-test.scm
+++ b/tests/scene-loader-test.scm
@@ -33,7 +33,7 @@
(module downstroke-world *
(import scheme (chicken base) defstruct)
(defstruct camera x y)
- (defstruct scene entities tilemap tileset camera tileset-texture camera-target background)
+ (defstruct scene entities tilemap tileset camera tileset-texture camera-target background engine-update)
(define (scene-add-entity scene entity)
(update-scene scene
entities: (append (scene-entities scene) (list entity)))))
@@ -124,5 +124,19 @@
'font
(car font))))
+(test-group "make-sprite-scene"
+ (let ((s (make-sprite-scene)))
+ (test "tilemap is #f" #f (scene-tilemap s))
+ (test "entities defaults to empty" '() (scene-entities s)))
+ (let* ((ts (make-tileset tilewidth: 8 tileheight: 8 spacing: 0 tilecount: 4
+ columns: 2 image-source: "" image: #f))
+ (s (make-sprite-scene tileset: ts
+ entities: (list (entity #:type 'a))
+ background: '(0 0 0))))
+ (test "tileset passed through" ts (scene-tileset s))
+ (test "entities passed through" 1 (length (scene-entities s)))
+ (test "background passed through" '(0 0 0) (scene-background s))
+ (test-assert "camera defaults to an origin camera" (scene-camera s))))
+
(test-end "scene-loader")
(test-exit)