(import test) (include "assets.scm") (import (downstroke assets)) (test-begin "assets") (test-group "make-asset-registry" (test-assert "returns a value" (make-asset-registry))) (test-group "asset-set! and asset-ref" (let ((reg (make-asset-registry))) (test "missing key returns #f" #f (asset-ref reg 'missing)) (asset-set! reg 'my-tilemap "data") (test "stored value is retrievable" "data" (asset-ref reg 'my-tilemap)) (asset-set! reg 'my-tilemap "updated") (test "overwrite replaces value" "updated" (asset-ref reg 'my-tilemap)) (asset-set! reg 'other 42) (test "multiple keys coexist" "updated" (asset-ref reg 'my-tilemap)) (test "second key retrievable" 42 (asset-ref reg 'other)))) (test-end "assets") (test-exit)