summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am13
-rw-r--r--tests/random.scm17
2 files changed, 27 insertions, 3 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 12699f9..7efc3d1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,12 +1,19 @@
-TESTS = \
- %reldir%/load-library.scm \
+TESTS = %reldir%/load-library.scm \
%reldir%/base64-ok.scm \
- %reldir%/base64-error.scm
+ %reldir%/base64-error.scm \
+ %reldir%/random.scm
EXTRA_DIST += $(TESTS)
TEST_EXTENSIONS = .scm
+.PHONY: %canon_reldir%-clean-local
+
+clean-local: %canon_reldir%-clean-local
+
+%canon_reldir%-clean-local:
+ rm -rf %reldir%/*.cache
+
AM_TESTS_ENVIRONMENT = $(top_builddir)/pre-inst-env
SCM_LOG_COMPILER = $(GUILE)
AM_SCM_LOG_FLAGS = --no-auto-compile -s
diff --git a/tests/random.scm b/tests/random.scm
new file mode 100644
index 0000000..9b85b15
--- /dev/null
+++ b/tests/random.scm
@@ -0,0 +1,17 @@
+(use-modules (webid-oidc stubs)
+ (webid-oidc testing))
+
+(with-test-environment
+ "random"
+ (lambda ()
+ (let ((data (random 12))
+ (expected "68OMG_V5x-KmI6TI"))
+ (unless (string=? data expected)
+ (format (current-error-port)
+ "Non-reproducibility issue with the random number generator:
+expected: ~a
+obtained: ~a
+"
+ expected
+ data)
+ (exit 1)))))