From ed799e4bbb7706d801632a0fcaa267954b998855 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 26 Jul 2021 13:27:22 -0400 Subject: [PATCH] Issue #279 - Add unit tests --- Makefile | 3 ++- tests/threading.scm | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 tests/threading.scm diff --git a/Makefile b/Makefile index d442b97b..8f8fb7fc 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,8 @@ TEST_SRC = $(TEST_DIR)/unit-tests.scm \ $(TEST_DIR)/srfi-60-tests.scm \ $(TEST_DIR)/srfi-121-tests.scm \ $(TEST_DIR)/srfi-128-162-tests.scm \ - $(TEST_DIR)/srfi-143-tests.scm + $(TEST_DIR)/srfi-143-tests.scm \ + $(TEST_DIR)/threading.scm TESTS = $(basename $(TEST_SRC)) # Primary rules (of interest to an end user) diff --git a/tests/threading.scm b/tests/threading.scm new file mode 100644 index 00000000..45584601 --- /dev/null +++ b/tests/threading.scm @@ -0,0 +1,22 @@ +;;;; Cyclone Scheme +;;;; https://github.com/justinethier/cyclone +;;;; +;;;; Copyright (c) 2014-2021, Justin Ethier +;;;; All rights reserved. +;;;; +;;;; This module contains unit tests for threading / SRFI 18. +;;;; + +(import + (scheme base) + (srfi 18) + (cyclone test)) + + +(test-group + "thread-join!" + (let ((t (thread-start! (make-thread (lambda () (expt 2 100)))))) + (test (expt 2 100) (thread-join! t))) +) + +(test-exit)