From ecafa5d239474fb6cfde84c3fe5a1267cd3d0bbb Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sat, 10 Aug 2024 18:02:12 +0200 Subject: tests: quantity testing --- tests/parse.scm | 15 ++++++++++----- 1 file 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")) -- cgit v1.2.3