summaryrefslogtreecommitdiff
path: root/tests/parse.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parse.scm')
-rw-r--r--tests/parse.scm15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/parse.scm b/tests/parse.scm
index c4670e0..28707a0 100644
--- a/tests/parse.scm
+++ b/tests/parse.scm
@@ -4,10 +4,16 @@
(cook debug)
(cook parse-internals))
-(test "Amount with unit"
- (list 'amount "10" "l") (cook->list (parse amount "10%l")))
-(test "Amount without unit"
- (list 'amount "10" #f) (cook->list (parse amount "10")))
+(test-group "Amount"
+ (test "with unit"
+ (list 'amount 10 "l") (cook->list (parse amount "10%l")))
+ (test "without unit"
+ (list 'amount 10 #f) (cook->list (parse amount "10"))))
+
+(test-group "Quantity"
+ (test "integer" 10 (parse quantity "10"))
+ (test "float" 10.1 (parse quantity "10.1"))
+ (test "fraction" 1/10 (parse quantity "1/10")))
;(define (test x y)
; (display "Testing: ")
@@ -25,7 +31,6 @@
;
;(test 'WORD (parse word "hola. adios"))
;(test 'UNIT (parse unit "l"))
-;(test 'QUANTITY (parse quantity "10"))
;(test 'WORD-COMPONENT (parse-fully component "word{}"))
;(test 'WORD-COMPONENT (parse-fully component "word{9%head}"))
;(test 'WORD-COMPONENT (parse-fully component "word"))