From 38eee24832fe6da4f135cae455881ab97953b23a Mon Sep 17 00:00:00 2001 From: Gene Pasquet Date: Sat, 18 Apr 2026 02:47:10 +0100 Subject: Refresh docs and re-indent --- tests/engine-test.scm | 6 ++++++ tests/scene-loader-test.scm | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'tests') 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) -- cgit v1.2.3