From 434435a11e53dc8a2238e12c73f2bf6d2f725bc8 Mon Sep 17 00:00:00 2001 From: Antoine Belvire Date: Thu, 6 Nov 2025 13:18:41 +0100 Subject: [PATCH] Test special-symbol? This closes #498. --- .../core_test/special_symbol_qmark.cljc | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 test/clojure/core_test/special_symbol_qmark.cljc diff --git a/test/clojure/core_test/special_symbol_qmark.cljc b/test/clojure/core_test/special_symbol_qmark.cljc new file mode 100644 index 0000000..1b961c0 --- /dev/null +++ b/test/clojure/core_test/special_symbol_qmark.cljc @@ -0,0 +1,51 @@ +(ns clojure.core-test.special-symbol-qmark + (:require [clojure.test :refer [deftest testing are]] + [clojure.core-test.portability #?(:cljs :refer-macros :default :refer) [when-var-exists]])) + +(when-var-exists special-symbol? + (deftest test-special-symbol? + + (testing "special symbols" + (are [arg] (special-symbol? 'arg) + & + . + case* + catch + def + deftype* + do + finally + fn* + if + let* + letfn* + loop* + new + quote + recur + set! + throw + try + var)) + + (testing "more special symbols" + #?(:cljs "cljs doesn't have these" + :default (are [arg] (special-symbol? 'arg) + clojure.core/import* + monitor-enter + monitor-exit + reify*))) + + (testing "not special symbols" + (are [arg] (not (special-symbol? arg)) + 'a-symbol + 'a-ns/a-qualified-symbol + 'defn + 'import + "not a symbol" + :k + 0 + 0.0 + true + false + nil))))