From 7f471fde70ef66c3e9bcbe4d96885e9455722da1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 9 Sep 2019 20:41:51 -0700 Subject: tests: add tests for digits function. * tests/016/arith.tl: Add various digits tests. --- tests/016/arith.tl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/016/arith.tl b/tests/016/arith.tl index f1f34c4f..eaa7fe2f 100644 --- a/tests/016/arith.tl +++ b/tests/016/arith.tl @@ -39,3 +39,21 @@ (vtest (mod c b) 0) (vtest (mod (pred c) a) (pred a)) (vtest (mod (pred c) b) (pred b)))) + +(test (digits 0) (0)) +(test (digits 1) (1)) +(test (digits 9) (9)) +(test (digits 10) (1 0)) +(test (digits 19) (1 9)) +(test (digits 20) (2 0)) +(test (digits 37) (3 7)) +(test (digits 100) (1 0 0)) +(test (digits 101) (1 0 1)) +(test (digits 999) (9 9 9)) +(test (digits 1000) (1 0 0 0)) +(test (digits 0 2) (0)) +(test (digits 1 2) (1)) +(test (digits 2 2) (1 0)) +(test (digits 3 2) (1 1)) +(test (digits 7 2) (1 1 1)) +(test (digits 8 2) (1 0 0 0)) -- cgit v1.2.3