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.scm12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/input-test.scm b/tests/input-test.scm
index 2173f61..44af6e8 100644
--- a/tests/input-test.scm
+++ b/tests/input-test.scm
@@ -125,35 +125,35 @@
(test-equal "entity returned as-is" e out)))
(test-group "no actions held: velocity is zero"
- (let* ((e (make-player-entity 0 0 16 16))
+ (let* ((e (make-entity 0 0 16 16))
(out (apply-input-to-entity e (lambda (a) #f))))
(test-equal "vx is 0" 0 (entity-ref out #:vx))
(test-equal "vy is 0" 0 (entity-ref out #:vy))))
(test-group "right held: vx=2 vy=0"
- (let* ((e (make-player-entity 0 0 16 16))
+ (let* ((e (make-entity 0 0 16 16))
(out (apply-input-to-entity e (lambda (a) (eq? a 'right)))))
(test-equal "vx is 2" 2 (entity-ref out #:vx))
(test-equal "vy is 0" 0 (entity-ref out #:vy))))
(test-group "right+down held: vx=2 vy unchanged"
- (let* ((e (make-player-entity 0 0 16 16))
+ (let* ((e (make-entity 0 0 16 16))
(out (apply-input-to-entity e (lambda (a) (memv a '(right down))))))
(test-equal "vx is 2" 2 (entity-ref out #:vx))
(test-equal "vy is unchanged (input handler does not set vy)" 0 (entity-ref out #:vy))))
(test-group "right held: facing set to 1"
- (let* ((e (make-player-entity 0 0 16 16))
+ (let* ((e (make-entity 0 0 16 16))
(out (apply-input-to-entity e (lambda (a) (eq? a 'right)))))
(test-equal "facing is 1" 1 (entity-ref out #:facing 0))))
(test-group "left held: facing set to -1"
- (let* ((e (make-player-entity 0 0 16 16))
+ (let* ((e (make-entity 0 0 16 16))
(out (apply-input-to-entity e (lambda (a) (eq? a 'left)))))
(test-equal "facing is -1" -1 (entity-ref out #:facing 0))))
(test-group "no key held: facing retains previous value"
- (let* ((e (entity-set (make-player-entity 0 0 16 16) #:facing 1))
+ (let* ((e (entity-set (make-entity 0 0 16 16) #:facing 1))
(out (apply-input-to-entity e (lambda (a) #f))))
(test-equal "facing stays 1 when vx=0" 1 (entity-ref out #:facing 0)))))