aboutsummaryrefslogtreecommitdiff
path: root/tests/input-test.scm
diff options
context:
space:
mode:
authorGene Pasquet <dev@etenil.net>2026-04-17 16:30:34 +0100
committerGene Pasquet <dev@etenil.net>2026-04-17 16:30:34 +0100
commit8251c85a4a588504d38a2fad05e4b0fe1cdccb9d (patch)
treec3fcedb7331caf798f2355c7549b35aa3aaf6ac8 /tests/input-test.scm
parent5de3b9cf122542f2a0c1c906c8ce8add20e5c8c6 (diff)
Convert entities to alists
Diffstat (limited to 'tests/input-test.scm')
-rw-r--r--tests/input-test.scm11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/input-test.scm b/tests/input-test.scm
index 0d1e4b5..bbc5599 100644
--- a/tests/input-test.scm
+++ b/tests/input-test.scm
@@ -14,6 +14,11 @@
(include "entity.scm")
(import downstroke-entity)
+(import (only (list-utils alist) plist->alist))
+
+;; Test helper: build an alist entity from plist-style keyword args.
+(define (entity . kws) (plist->alist kws))
+
;; Load the module source directly
(include "input.scm")
;; Now import it to access the exported functions
@@ -119,13 +124,13 @@
(define (make-physics-entity)
(entity-set-many (make-entity 0 0 16 16)
- '((#:vx 0) (#:vy 0)
- (#:input-map ((left . (-2 . 0)) (right . (2 . 0)))))))
+ `((#:vx . 0) (#:vy . 0)
+ (#:input-map . ((left . (-2 . 0)) (right . (2 . 0)))))))
;; Test: apply-input-to-entity applies input to entity
(test-group "apply-input-to-entity"
(test-group "no input-map: entity unchanged"
- (let* ((e '(#:type player #:x 5 #:y 10))
+ (let* ((e (entity #:type 'player #:x 5 #:y 10))
(out (apply-input-to-entity e (lambda (a) #f))))
(test-equal "entity returned as-is" e out)))