Refactor(Structure): Move ADTs into adt/ folder, rename spel.rkt to main.rkt
New structure groups all ADT modules under adt/ directory, removing redundant adt- prefix from filenames. Library names now read as (pacman-project adt position) etc. All imports updated accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
30
pacman-project/tests/test-score.rkt
Normal file
30
pacman-project/tests/test-score.rkt
Normal file
@@ -0,0 +1,30 @@
|
||||
#lang r7rs
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Tests: Score ADT ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define-library (pacman-project tests test-score)
|
||||
(import (scheme base)
|
||||
(pp1 tests)
|
||||
(pacman-project adt score))
|
||||
(export test)
|
||||
|
||||
(begin
|
||||
|
||||
;; Test initial score
|
||||
(define (test-initial)
|
||||
(define s (make-score))
|
||||
(check-eq? (s 'points) 0 "Initial score should be 0"))
|
||||
|
||||
;; Test score increase
|
||||
(define (test-increase)
|
||||
(define s (make-score))
|
||||
((s 'increase!))
|
||||
(check-eq? (s 'points) 10 "Score should be 10 after 1 coin")
|
||||
((s 'increase!))
|
||||
(check-eq? (s 'points) 20 "Score should be 20 after 2 coins"))
|
||||
|
||||
(define (test)
|
||||
(run-test test-initial "Score: initial score")
|
||||
(run-test test-increase "Score: increase"))))
|
||||
Reference in New Issue
Block a user