aboutsummaryrefslogtreecommitdiff
path: root/tests/input-test.scm
diff options
context:
space:
mode:
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)))