aboutsummaryrefslogtreecommitdiff
path: root/tests/scene-loader-test.scm
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/scene-loader-test.scm
parenta02b892e2ad1e1605ff942c63afdd618daa48be4 (diff)
Refresh docs and re-indent
Diffstat (limited to 'tests/scene-loader-test.scm')
-rw-r--r--tests/scene-loader-test.scm16
1 files changed, 15 insertions, 1 deletions
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)