(use test) (use simple-units) (test-error (make-units* foo z a (2 b) b (2 c) c (3 c))) (define singleton (make-units* singleton foo)) (test-assert (units? singleton)) (test 'singleton (units-name singleton)) (test 'foo (units-base-name singleton)) (test (default-units-system) (units-units-system singleton)) (test '(foo) (units-unit-names singleton)) (test 1 (units-unit-factor singleton 'foo)) (define time-units* (make-units* time s m 60 h (60 m) d (24 h) ms (0.0001 s) us (0.0001 ms))) (test 84203 (+ (quantity 23 h time-units*) (quantity 23 m time-units*) (quantity 23 s time-units*))) (define time-units (make-units time s m 60 h (60 m) d (24 h) ms (0.0001 s) us (0.0001 ms))) (test 84203 (+ (quantity 23 h) (quantity 23 m) (quantity 23 s))) (test-assert (units=? time-units time-units*)) ;not a good test, should make own units-system (test 'default (units-system-name)) (test-assert (list? (units-system-catalog))) (test time-units (units-system-units 'time)) (test time-units (units-system-units/unit 'd)) ;need mutiple units, with clashing unit names