diff options
| author | Gene Pasquet <dev@etenil.net> | 2026-04-10 00:39:54 +0100 |
|---|---|---|
| committer | Gene Pasquet <dev@etenil.net> | 2026-04-10 00:39:54 +0100 |
| commit | 6734511622f6cc9c625bec6a2ee55413f0689946 (patch) | |
| tree | 7eaa974bc39775c838a2e9f36d05e00c7bfd0dbc /tests/input-test.scm | |
| parent | afc30a12e25215ff5e9226c3b4f8fd127d9a4d68 (diff) | |
Remove useless make-player-entity
Diffstat (limited to 'tests/input-test.scm')
| -rw-r--r-- | tests/input-test.scm | 12 |
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))))) |
