From 6734511622f6cc9c625bec6a2ee55413f0689946 Mon Sep 17 00:00:00 2001 From: Gene Pasquet Date: Fri, 10 Apr 2026 00:39:54 +0100 Subject: Remove useless make-player-entity --- tests/entity-test.scm | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) (limited to 'tests/entity-test.scm') diff --git a/tests/entity-test.scm b/tests/entity-test.scm index 795aa1c..270555c 100644 --- a/tests/entity-test.scm +++ b/tests/entity-test.scm @@ -29,6 +29,15 @@ 42 (entity-ref entity #:x (lambda () 42))))) +;; Test: make-player-entity creates valid player entity +(test-group "make-entity" + (let ((player (make-entity 50 75 16 16))) + (test-assert "returns a list" (list? player)) + (test-equal "has correct x" 50 (entity-ref player #:x)) + (test-equal "has correct y" 75 (entity-ref player #:y)) + (test-equal "has correct width" 16 (entity-ref player #:width)) + (test-equal "has correct height" 16 (entity-ref player #:height)))) + ;; Test: entity-type extracts type from entity (test-group "entity-type" (let ((player '(#:type player #:x 100)) @@ -38,19 +47,8 @@ (let ((no-type '(#:x 100 #:y 200))) (test-equal "returns #f for entity without type" - #f - (entity-type no-type)))) - -;; Test: make-player-entity creates valid player entity -(test-group "make-player-entity" - (let ((player (make-player-entity 50 75 16 16))) - (test-assert "returns a list" (list? player)) - (test-equal "has correct type" 'player (entity-ref player #:type)) - (test-equal "has correct x" 50 (entity-ref player #:x)) - (test-equal "has correct y" 75 (entity-ref player #:y)) - (test-equal "has correct width" 16 (entity-ref player #:width)) - (test-equal "has correct height" 16 (entity-ref player #:height)) - (test-equal "has initial tile-id" 29 (entity-ref player #:tile-id)))) + #f + (entity-type no-type)))) ;; Test: complex entity with multiple properties (test-group "complex-entity" @@ -100,19 +98,6 @@ (let ((e (entity-update '(#:x 10 #:y 20) #:x (lambda (v) (* v 2))))) (test-equal "length is 4" 4 (length e))))) -;; Test: make-player-entity velocity fields -(test-group "make-player-entity-velocity-fields" - (let* ((p (make-player-entity 5 10 16 16)) - (imap (entity-ref p #:input-map #f))) - (test-equal "vx defaults to 0" 0 (entity-ref p #:vx)) - (test-equal "vy defaults to 0" 0 (entity-ref p #:vy)) - (test-assert "input-map is present" imap) - ;; Each entry is (action . (dvx . dvy)); assq returns (action . (dvx . dvy)) - (test-equal "left dvx" -2 (car (cdr (assq 'left imap)))) - (test-equal "left dvy" 0 (cdr (cdr (assq 'left imap)))) - (test-equal "right dvx" 2 (car (cdr (assq 'right imap)))) - (test-equal "right dvy" 0 (cdr (cdr (assq 'right imap)))))) - (test-group "entity-skips-pipeline?" (test-assert "absent skip list" (not (entity-skips-pipeline? '(#:type a) 'gravity))) -- cgit v1.2.3